diff options
author | Douwe Maan <douwe@selenight.nl> | 2018-04-02 20:40:11 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-04-10 15:46:20 +0200 |
commit | bdd7600de71c9490be4ba4ddc27999b490b7cf8a (patch) | |
tree | 23d9617013d3ee6c1b4a058f69bea74b6c5cd407 /spec/views | |
parent | 8272ec9a7683863c43d217c97bdf7bf165cb3cf2 (diff) | |
download | gitlab-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.rb | 9 |
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 |