summaryrefslogtreecommitdiff
path: root/spec/views/shared/projects/_list.html.haml_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/views/shared/projects/_list.html.haml_spec.rb')
-rw-r--r--spec/views/shared/projects/_list.html.haml_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/views/shared/projects/_list.html.haml_spec.rb b/spec/views/shared/projects/_list.html.haml_spec.rb
index 037f988257b..5c38bb79ea1 100644
--- a/spec/views/shared/projects/_list.html.haml_spec.rb
+++ b/spec/views/shared/projects/_list.html.haml_spec.rb
@@ -20,6 +20,18 @@ RSpec.describe 'shared/projects/_list' do
expect(rendered).to have_content(project.name)
end
end
+
+ it "will not show elements a user shouldn't be able to see" do
+ allow(view).to receive(:can_show_last_commit_in_list?).and_return(false)
+ allow(view).to receive(:able_to_see_merge_requests?).and_return(false)
+ allow(view).to receive(:able_to_see_issues?).and_return(false)
+
+ render
+
+ expect(rendered).not_to have_css('a.commit-row-message')
+ expect(rendered).not_to have_css('a.issues')
+ expect(rendered).not_to have_css('a.merge-requests')
+ end
end
context 'without projects' do