Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
f456fce2
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f456fce2
编写于
9月 26, 2014
作者:
C
Ciro Santilli
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add web UI file CRUD tests.
me/ciro/bak/git/cirosantilli.com/web'
上级
fd338d67
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
102 addition
and
4 deletion
+102
-4
features/project/source/browse_files.feature
features/project/source/browse_files.feature
+30
-0
features/steps/project/browse_files.rb
features/steps/project/browse_files.rb
+72
-4
未找到文件。
features/project/source/browse_files.feature
浏览文件 @
f456fce2
...
...
@@ -24,12 +24,32 @@ Feature: Project Browse files
Given
I click on
"new file"
link in repo
Then
I can see new file page
@javascript
Scenario
:
I
can create and commit file
Given
I click on
"new file"
link in repo
And
I edit code
And
I fill the new file name
And
I fill the commit message
And
I click on
"Commit changes"
Then
I am redirected to the new file
And
I should see its new content
@javascript
Scenario
:
I
can edit file
Given
I click on
".gitignore"
file in repo
And
I click button
"edit"
Then
I can edit code
@javascript
Scenario
:
I
can edit and commit file
Given
I click on
".gitignore"
file in repo
And
I click button
"edit"
And
I edit code
And
I fill the commit message
And
I click on
"Commit changes"
Then
I am redirected to the
".gitignore"
And
I should see its new content
@javascript
Scenario
:
I
can see editing preview
Given
I click on
".gitignore"
file in repo
...
...
@@ -38,6 +58,16 @@ Feature: Project Browse files
And
I click link
"Diff"
Then
I see diff
@javascript
Scenario
:
I
can remove file and commit
Given
I click on
".gitignore"
file in repo
And
I see the
".gitignore"
And
I click on
"remove"
And
I fill the commit message
And
I click on
"Remove file"
Then
I am redirected to the files URL
And
I don't see the
".gitignore"
Scenario
:
I
can browse directory with Browse Dir
Given
I click on files directory
And
I click on history link
...
...
features/steps/project/browse_files.rb
浏览文件 @
f456fce2
...
...
@@ -16,12 +16,24 @@ class Spinach::Features::ProjectBrowseFiles < Spinach::FeatureSteps
page
.
should
have_content
"LICENSE"
end
step
'I see the ".gitignore"'
do
page
.
should
have_content
'.gitignore'
end
step
'I don\'t see the ".gitignore"'
do
page
.
should_not
have_content
'.gitignore'
end
step
'I click on ".gitignore" file in repo'
do
click_link
".gitignore"
end
step
'I should see its content'
do
page
.
should
have_content
"*.rbc"
page
.
should
have_content
old_gitignore_content
end
step
'I should see its new content'
do
page
.
should
have_content
new_gitignore_content
end
step
'I click link "raw"'
do
...
...
@@ -37,18 +49,38 @@ class Spinach::Features::ProjectBrowseFiles < Spinach::FeatureSteps
end
step
'I can edit code'
do
execute_script
(
'editor.setValue("GitlabFileEditor")'
)
evaluate_script
(
'editor.getValue()'
).
should
==
"GitlabFileEditor"
set_new_content
evaluate_script
(
'editor.getValue()'
).
should
==
new_gitignore_content
end
step
'I edit code'
do
execute_script
(
'editor.setValue("GitlabFileEditor")'
)
set_new_content
end
step
'I fill the new file name'
do
fill_in
:file_name
,
with:
new_file_name
end
step
'I fill the commit message'
do
fill_in
:commit_message
,
with:
'Not yet a commit message.'
end
step
'I click link "Diff"'
do
click_link
'Diff'
end
step
'I click on "Commit changes"'
do
click_button
'Commit changes'
end
step
'I click on "remove"'
do
click_link
'remove'
end
step
'I click on "Remove file"'
do
click_button
'Remove file'
end
step
'I see diff'
do
page
.
should
have_css
'.line_holder.new'
end
...
...
@@ -97,12 +129,48 @@ class Spinach::Features::ProjectBrowseFiles < Spinach::FeatureSteps
click_link
'permalink'
end
step
'I am redirected to the files URL'
do
current_path
.
should
==
project_tree_path
(
@project
,
'master'
)
end
step
'I am redirected to the ".gitignore"'
do
expect
(
current_path
).
to
eq
(
project_blob_path
(
@project
,
'master/.gitignore'
))
end
step
'I am redirected to the permalink URL'
do
expect
(
current_path
).
to
eq
(
project_blob_path
(
@project
,
@project
.
repository
.
commit
.
sha
+
'/.gitignore'
))
end
step
'I am redirected to the new file'
do
expect
(
current_path
).
to
eq
(
project_blob_path
(
@project
,
'master/'
+
new_file_name
))
end
step
"I don't see the permalink link"
do
expect
(
page
).
not_to
have_link
(
'permalink'
)
end
private
def
set_new_content
execute_script
(
"editor.setValue('
#{
new_gitignore_content
}
')"
)
end
# Content of the gitignore file on the seed repository.
def
old_gitignore_content
'*.rbc'
end
# Constant value that differs from the content
# of the gitignore of the seed repository.
def
new_gitignore_content
old_gitignore_content
+
'a'
end
# Constant value that is a valid filename and
# not a filename present at root of the seed repository.
def
new_file_name
'not_a_file.md'
end
end
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录