Commit e46849c4 authored by Douwe Maan's avatar Douwe Maan

Merge branch 'fix-disabled-project-snippet-feature' into 'master'

Fix project snippets button appearing when it is disabled

There was a typo in 9bcd3639 that caused the project snippets option to be shown when it is disabled.

Closes #1705

See merge request !720
parents 97f9d601 ab88b7da
...@@ -115,7 +115,7 @@ class Ability ...@@ -115,7 +115,7 @@ class Ability
end end
unless project.snippets_enabled unless project.snippets_enabled
rules -= named_abilities('snippet') rules -= named_abilities('project_snippet')
end end
unless project.wiki_enabled unless project.wiki_enabled
......
...@@ -68,3 +68,8 @@ Feature: Project ...@@ -68,3 +68,8 @@ Feature: Project
When I visit project "Shop" page When I visit project "Shop" page
Then I should not see "New Issue" button Then I should not see "New Issue" button
And I should not see "New Merge Request" 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
...@@ -110,4 +110,8 @@ class Spinach::Features::Project < Spinach::FeatureSteps ...@@ -110,4 +110,8 @@ class Spinach::Features::Project < Spinach::FeatureSteps
step 'I should not see "New Merge Request" button' do step 'I should not see "New Merge Request" button' do
page.should_not have_link 'New Merge Request' page.should_not have_link 'New Merge Request'
end end
step 'I should not see "Snippets" button' do
page.should_not have_link 'Snippets'
end
end end
...@@ -14,6 +14,11 @@ module SharedProject ...@@ -14,6 +14,11 @@ module SharedProject
@project.team << [@user, :master] @project.team << [@user, :master]
end 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 step 'I disable issues and merge requests in project' do
@project.issues_enabled = false @project.issues_enabled = false
@project.merge_requests_enabled = false @project.merge_requests_enabled = false
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment