Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ab88b7da
Commit
ab88b7da
authored
May 27, 2015
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix project snippets button appearing when it is disabled
Closes #1705
parent
4146ce55
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
1 deletion
+15
-1
app/models/ability.rb
app/models/ability.rb
+1
-1
features/project/project.feature
features/project/project.feature
+5
-0
features/steps/project/project.rb
features/steps/project/project.rb
+4
-0
features/steps/shared/project.rb
features/steps/shared/project.rb
+5
-0
No files found.
app/models/ability.rb
View file @
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
...
...
features/project/project.feature
View file @
ab88b7da
...
@@ -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
features/steps/project/project.rb
View file @
ab88b7da
...
@@ -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
features/steps/shared/project.rb
View file @
ab88b7da
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment