summaryrefslogtreecommitdiff
path: root/spec/views
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2018-04-02 20:40:11 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2018-04-10 15:46:20 +0200
commitbdd7600de71c9490be4ba4ddc27999b490b7cf8a (patch)
tree23d9617013d3ee6c1b4a058f69bea74b6c5cd407 /spec/views
parent8272ec9a7683863c43d217c97bdf7bf165cb3cf2 (diff)
downloadgitlab-ce-bdd7600de71c9490be4ba4ddc27999b490b7cf8a.tar.gz
Add ability checks in views where they were previously missing
Diffstat (limited to 'spec/views')
-rw-r--r--spec/views/projects/commit/_commit_box.html.haml_spec.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/spec/views/projects/commit/_commit_box.html.haml_spec.rb b/spec/views/projects/commit/_commit_box.html.haml_spec.rb
index 448b925cf34..fb5087f5090 100644
--- a/spec/views/projects/commit/_commit_box.html.haml_spec.rb
+++ b/spec/views/projects/commit/_commit_box.html.haml_spec.rb
@@ -7,6 +7,8 @@ describe 'projects/commit/_commit_box.html.haml' do
before do
assign(:project, project)
assign(:commit, project.commit)
+ assign(:current_user, user)
+ allow(view).to receive(:current_user).and_return(user)
allow(view).to receive(:can_collaborate_with_project?).and_return(false)
end
@@ -47,7 +49,8 @@ describe 'projects/commit/_commit_box.html.haml' do
context 'viewing a commit' do
context 'as a developer' do
before do
- expect(view).to receive(:can_collaborate_with_project?).and_return(true)
+ project.add_developer(user)
+ allow(view).to receive(:can_collaborate_with_project?).and_return(true)
end
it 'has a link to create a new tag' do
@@ -58,10 +61,6 @@ describe 'projects/commit/_commit_box.html.haml' do
end
context 'as a non-developer' do
- before do
- expect(view).to receive(:can_collaborate_with_project?).and_return(false)
- end
-
it 'does not have a link to create a new tag' do
render