summaryrefslogtreecommitdiff
path: root/spec/views/shared/projects/_list.html.haml_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-04-20 10:00:54 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-04-20 10:00:54 +0000
commit3cccd102ba543e02725d247893729e5c73b38295 (patch)
treef36a04ec38517f5deaaacb5acc7d949688d1e187 /spec/views/shared/projects/_list.html.haml_spec.rb
parent205943281328046ef7b4528031b90fbda70c75ac (diff)
downloadgitlab-ce-3cccd102ba543e02725d247893729e5c73b38295.tar.gz
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
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