summaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-05-27 05:07:44 -0700
committerStan Hu <stanhu@gmail.com>2015-05-27 05:07:44 -0700
commitab88b7da19168c66404dfa9dfeb12110ccb8ceea (patch)
treec53bda448881f0efbce6e282558470f939c792d9 /features
parent4146ce559e8858604ec91d663eac15f9e5379ff0 (diff)
downloadgitlab-ce-ab88b7da19168c66404dfa9dfeb12110ccb8ceea.tar.gz
Fix project snippets button appearing when it is disabled
Closes #1705
Diffstat (limited to 'features')
-rw-r--r--features/project/project.feature5
-rw-r--r--features/steps/project/project.rb4
-rw-r--r--features/steps/shared/project.rb5
3 files changed, 14 insertions, 0 deletions
diff --git a/features/project/project.feature b/features/project/project.feature
index ef11bceed11..56ae5c78d01 100644
--- a/features/project/project.feature
+++ b/features/project/project.feature
@@ -68,3 +68,8 @@ Feature: Project
When I visit project "Shop" page
Then I should not see "New Issue" button
And I should not see "New Merge Request" button
+
+ Scenario: I should not see Project snippets
+ Given I disable snippets in project
+ When I visit project "Shop" page
+ Then I should not see "Snippets" button
diff --git a/features/steps/project/project.rb b/features/steps/project/project.rb
index 93fea693f89..fcc15aacc21 100644
--- a/features/steps/project/project.rb
+++ b/features/steps/project/project.rb
@@ -110,4 +110,8 @@ class Spinach::Features::Project < Spinach::FeatureSteps
step 'I should not see "New Merge Request" button' do
page.should_not have_link 'New Merge Request'
end
+
+ step 'I should not see "Snippets" button' do
+ page.should_not have_link 'Snippets'
+ end
end
diff --git a/features/steps/shared/project.rb b/features/steps/shared/project.rb
index 24136fe421c..3059c4ee041 100644
--- a/features/steps/shared/project.rb
+++ b/features/steps/shared/project.rb
@@ -14,6 +14,11 @@ module SharedProject
@project.team << [@user, :master]
end
+ step 'I disable snippets in project' do
+ @project.snippets_enabled = false
+ @project.save
+ end
+
step 'I disable issues and merge requests in project' do
@project.issues_enabled = false
@project.merge_requests_enabled = false