summaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
authorEric Eastwood <contact@ericeastwood.com>2017-04-06 16:36:38 +0000
committerAlfredo Sumaran <alfredo@gitlab.com>2017-04-06 16:36:38 +0000
commitb42dc1a52b5687972262e634cad589345fe49373 (patch)
tree1786fb11cc0615674e2bc14338331d6e8ffc740f /features
parent3f60fe1a6045bac777357aa0d962e1a11552468c (diff)
downloadgitlab-ce-b42dc1a52b5687972262e634cad589345fe49373.tar.gz
Linking to edit file directly
Diffstat (limited to 'features')
-rw-r--r--features/project/source/browse_files.feature4
-rw-r--r--features/steps/project/source/browse_files.rb12
2 files changed, 15 insertions, 1 deletions
diff --git a/features/project/source/browse_files.feature b/features/project/source/browse_files.feature
index d4b91fec6e8..5ede935c562 100644
--- a/features/project/source/browse_files.feature
+++ b/features/project/source/browse_files.feature
@@ -158,6 +158,8 @@ Feature: Project Source Browse Files
Given I don't have write access
And I click on ".gitignore" file in repo
And I click button "Edit"
+ Then I should see a Fork/Cancel combo
+ And I click button "Fork"
Then I should see a notice about a new fork having been created
And I can edit code
@@ -180,6 +182,8 @@ Feature: Project Source Browse Files
Given I don't have write access
And I click on ".gitignore" file in repo
And I click button "Edit"
+ Then I should see a Fork/Cancel combo
+ And I click button "Fork"
And I edit code
And I fill the commit message
And I click on "Commit Changes"
diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb
index 5c47eaf0279..29f628763db 100644
--- a/features/steps/project/source/browse_files.rb
+++ b/features/steps/project/source/browse_files.rb
@@ -56,13 +56,17 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
end
step 'I click button "Edit"' do
- click_link 'Edit'
+ find('.js-edit-blob').click
end
step 'I cannot see the edit button' do
expect(page).not_to have_link 'edit'
end
+ step 'I click button "Fork"' do
+ click_link 'Fork'
+ end
+
step 'I can edit code' do
set_new_content
expect(evaluate_script('ace.edit("editor").getValue()')).to eq new_gitignore_content
@@ -366,6 +370,12 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
end
end
+ step 'I should see a Fork/Cancel combo' do
+ expect(page).to have_link 'Fork'
+ expect(page).to have_button 'Cancel'
+ expect(page).to have_content 'You don\'t have permission to edit this file. Try forking this project to edit the file.'
+ end
+
step 'I should see a notice about a new fork having been created' do
expect(page).to have_content "You're not allowed to make changes to this project directly. A fork of this project has been created that you can make changes in, so you can submit a merge request."
end