Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
3177693c
Commit
3177693c
authored
Feb 23, 2015
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WebEditor: save to new branch: spinach
parent
71a844cd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
1 deletion
+36
-1
features/project/source/browse_files.feature
features/project/source/browse_files.feature
+22
-0
features/steps/project/source/browse_files.rb
features/steps/project/source/browse_files.rb
+14
-1
No files found.
features/project/source/browse_files.feature
View file @
3177693c
...
@@ -34,6 +34,17 @@ Feature: Project Source Browse Files
...
@@ -34,6 +34,17 @@ Feature: Project Source Browse Files
Then
I am redirected to the new file
Then
I am redirected to the new file
And
I should see its new content
And
I should see its new content
@javascript
Scenario
:
I
can create and commit file and specify new branch
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 fill the new branch name
And
I click on
"Commit Changes"
Then
I am redirected to the new file on new branch
And
I should see its new content
@javascript
@tricky
@javascript
@tricky
Scenario
:
I
can create file in empty repo
Scenario
:
I
can create file in empty repo
Given
I own an empty project
Given
I own an empty project
...
@@ -83,6 +94,17 @@ Feature: Project Source Browse Files
...
@@ -83,6 +94,17 @@ Feature: Project Source Browse Files
Then
I am redirected to the
".gitignore"
Then
I am redirected to the
".gitignore"
And
I should see its new content
And
I should see its new content
@javascript
Scenario
:
I
can edit and commit file to new branch
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 fill the new branch name
And
I click on
"Commit Changes"
Then
I am redirected to the
".gitignore"
on new branch
And
I should see its new content
@javascript
@wip
@javascript
@wip
Scenario
:
If I don't change the content of the file I see an error message
Scenario
:
If I don't change the content of the file I see an error message
Given
I click on
".gitignore"
file in repo
Given
I click on
".gitignore"
file in repo
...
...
features/steps/project/source/browse_files.rb
View file @
3177693c
...
@@ -69,6 +69,10 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
...
@@ -69,6 +69,10 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
fill_in
:file_name
,
with:
new_file_name
fill_in
:file_name
,
with:
new_file_name
end
end
step
'I fill the new branch name'
do
fill_in
:new_branch
,
with:
'new_branch_name'
end
step
'I fill the new file name with an illegal name'
do
step
'I fill the new file name with an illegal name'
do
fill_in
:file_name
,
with:
'.git'
fill_in
:file_name
,
with:
'.git'
end
end
...
@@ -148,6 +152,10 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
...
@@ -148,6 +152,10 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
expect
(
current_path
).
to
eq
(
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
'master/.gitignore'
))
expect
(
current_path
).
to
eq
(
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
'master/.gitignore'
))
end
end
step
'I am redirected to the ".gitignore" on new branch'
do
expect
(
current_path
).
to
eq
(
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
'new_branch_name/.gitignore'
))
end
step
'I am redirected to the permalink URL'
do
step
'I am redirected to the permalink URL'
do
expect
(
current_path
).
to
(
expect
(
current_path
).
to
(
eq
(
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
eq
(
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
...
@@ -161,6 +169,11 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
...
@@ -161,6 +169,11 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
@project
.
namespace
,
@project
,
'master/'
+
new_file_name
))
@project
.
namespace
,
@project
,
'master/'
+
new_file_name
))
end
end
step
'I am redirected to the new file on new branch'
do
expect
(
current_path
).
to
eq
(
namespace_project_blob_path
(
@project
.
namespace
,
@project
,
'new_branch_name/'
+
new_file_name
))
end
step
"I don't see the permalink link"
do
step
"I don't see the permalink link"
do
expect
(
page
).
not_to
have_link
(
'permalink'
)
expect
(
page
).
not_to
have_link
(
'permalink'
)
end
end
...
@@ -177,7 +190,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
...
@@ -177,7 +190,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
click_link
'add a file'
click_link
'add a file'
# Remove pre-receive hook so we can push without auth
# Remove pre-receive hook so we can push without auth
FileUtils
.
rm
(
File
.
join
(
@project
.
repository
.
path
,
'hooks'
,
'pre-receive'
))
FileUtils
.
rm
_f
(
File
.
join
(
@project
.
repository
.
path
,
'hooks'
,
'pre-receive'
))
end
end
private
private
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment