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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
84bcb040
Commit
84bcb040
authored
Jan 31, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove new branch button for confidential issues
parent
adc0e41f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
app/views/projects/issues/show.html.haml
app/views/projects/issues/show.html.haml
+1
-1
spec/features/issues/new_branch_button_spec.rb
spec/features/issues/new_branch_button_spec.rb
+14
-4
No files found.
app/views/projects/issues/show.html.haml
View file @
84bcb040
...
...
@@ -75,7 +75,7 @@
// This element is filled in using JavaScript.
.content-block.content-block-small
=
render
'new_branch'
=
render
'new_branch'
unless
@issue
.
confidential?
=
render
'award_emoji/awards_block'
,
awardable:
@issue
,
inline:
true
%section
.issuable-discussion
...
...
spec/features/issues/new_branch_button_spec.rb
View file @
84bcb040
require
'rails_helper'
feature
'Start new branch from an issue'
,
feature:
true
do
feature
'Start new branch from an issue'
,
feature:
true
,
js:
true
do
let!
(
:project
)
{
create
(
:project
)
}
let!
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let!
(
:user
)
{
create
(
:user
)}
...
...
@@ -11,7 +11,7 @@ feature 'Start new branch from an issue', feature: true do
login_as
(
user
)
end
it
'shows the new branch button'
,
js:
true
do
it
'shows the new branch button'
do
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
expect
(
page
).
to
have_css
(
'#new-branch .available'
)
...
...
@@ -34,16 +34,26 @@ feature 'Start new branch from an issue', feature: true do
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
end
it
"hides the new branch button"
,
js:
true
do
it
"hides the new branch button"
do
expect
(
page
).
to
have_css
(
'#new-branch .unavailable'
)
expect
(
page
).
not_to
have_css
(
'#new-branch .available'
)
expect
(
page
).
to
have_content
/1 Related Merge Request/
end
end
context
'when issue is confidential'
do
it
'hides the new branch button'
do
issue
=
create
(
:issue
,
:confidential
,
project:
project
)
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
expect
(
page
).
not_to
have_css
(
'#new-branch'
)
end
end
end
context
"for visiters"
do
it
'shows no buttons'
,
js:
true
do
it
'shows no buttons'
do
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
expect
(
page
).
not_to
have_css
(
'#new-branch'
)
...
...
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