Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-12-21 13:57:51 +0300
committerDouwe Maan <douwe@gitlab.com>2015-12-21 13:57:51 +0300
commitc910bca730561da3361faec56ef509e25a798c66 (patch)
tree564b719803088c14cf168b0723da1016e0e4474a /features/steps
parentc65243427f4c940aab35cc86e039c89c6264cf00 (diff)
Add tests for new functionality
Diffstat (limited to 'features/steps')
-rw-r--r--features/steps/project/source/browse_files.rb25
1 files changed, 20 insertions, 5 deletions
diff --git a/features/steps/project/source/browse_files.rb b/features/steps/project/source/browse_files.rb
index 898a8a0d0f6..d08935aa101 100644
--- a/features/steps/project/source/browse_files.rb
+++ b/features/steps/project/source/browse_files.rb
@@ -5,6 +5,12 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
include SharedPaths
include RepoHelpers
+ step "I don't have write access" do
+ @project = create(:project, name: "Other Project", path: "other-project")
+ @project.team << [@user, :reporter]
+ visit namespace_project_tree_path(@project.namespace, @project, root_ref)
+ end
+
step 'I should see files from repository' do
expect(page).to have_content "VERSION"
expect(page).to have_content ".gitignore"
@@ -87,7 +93,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
end
step 'I fill the commit message' do
- fill_in :commit_message, with: 'Not yet a commit message.', visible: true
+ fill_in :commit_message, with: 'New commit message', visible: true
end
step 'I click link "Diff"' do
@@ -103,7 +109,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
end
step 'I click on "Delete"' do
- click_button 'Delete'
+ click_on 'Delete'
end
step 'I click on "Delete file"' do
@@ -111,7 +117,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
end
step 'I click on "Replace"' do
- click_button "Replace"
+ click_on "Replace"
end
step 'I click on "Replace file"' do
@@ -155,7 +161,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
end
step 'I can see the new commit message' do
- expect(page).to have_content "New upload commit message"
+ expect(page).to have_content "New commit message"
end
step 'I upload a new text file' do
@@ -164,7 +170,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
step 'I fill the upload file commit message' do
page.within('#modal-upload-blob') do
- fill_in :commit_message, with: 'New upload commit message'
+ fill_in :commit_message, with: 'New commit message'
end
end
@@ -251,6 +257,11 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
expect(current_path).to eq(new_namespace_project_merge_request_path(@project.namespace, @project))
end
+ step "I am redirected to the fork's new merge request page" do
+ fork = @user.fork_of(@project)
+ expect(current_path).to eq(new_namespace_project_merge_request_path(fork.namespace, fork))
+ end
+
step 'I am redirected to the root directory' do
expect(current_path).to eq(
namespace_project_tree_path(@project.namespace, @project, 'master'))
@@ -336,6 +347,10 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
expect(page).to have_content 'Replace'
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
+
private
def set_new_content