summaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-02-25 11:59:25 +0100
committerDouwe Maan <douwe@gitlab.com>2015-02-25 11:59:25 +0100
commit5f7a3e1bbdcb6044e4b25d0a7722b10f9140bb46 (patch)
tree36f9c7a85a0dd20f0b271df464eed45c36e969b5 /features
parent769d1ce64bdb7c9fd3981c65bc25dd14eb176c1e (diff)
parenta30a56634d3ea44ccfc69c037324b502456f9aba (diff)
downloadgitlab-ce-5f7a3e1bbdcb6044e4b25d0a7722b10f9140bb46.tar.gz
Merge branch 'master' into extend_markdown_upload
# Conflicts: # app/controllers/files_controller.rb
Diffstat (limited to 'features')
-rw-r--r--features/project/source/browse_files.feature22
-rw-r--r--features/steps/project/source/browse_files.rb15
2 files changed, 36 insertions, 1 deletions
diff --git a/features/project/source/browse_files.feature b/features/project/source/browse_files.feature
index ee8d0bffa9b..90b966dd645 100644
--- a/features/project/source/browse_files.feature
+++ b/features/project/source/browse_files.feature
@@ -34,6 +34,17 @@ Feature: Project Source Browse Files
Then I am redirected to the new file
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
Scenario: I can create file in empty repo
Given I own an empty project
@@ -83,6 +94,17 @@ Feature: Project Source Browse Files
Then I am redirected to the ".gitignore"
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
Scenario: If I don't change the content of the file I see an error message
Given I click on ".gitignore" file in repo
diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb
index 98d8a60e1a5..557555aee58 100644
--- a/features/steps/project/source/browse_files.rb
+++ b/features/steps/project/source/browse_files.rb
@@ -69,6 +69,10 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
fill_in :file_name, with: new_file_name
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
fill_in :file_name, with: '.git'
end
@@ -148,6 +152,10 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
expect(current_path).to eq(namespace_project_blob_path(@project.namespace, @project, 'master/.gitignore'))
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
expect(current_path).to(
eq(namespace_project_blob_path(@project.namespace, @project,
@@ -161,6 +169,11 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
@project.namespace, @project, 'master/' + new_file_name))
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
expect(page).not_to have_link('permalink')
end
@@ -177,7 +190,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
click_link 'add a file'
# 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
private