diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-27 15:41:41 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-27 15:41:41 +0300 |
commit | c1c828ac7f7b3c2e51d81921bbef9d474cd4d0a4 (patch) | |
tree | 32fabcdfa49cd8eab122cf5efecb47db6d5e59bf /spec/controllers | |
parent | 547a5884d1ab6a22d9fc9ce79e5cf6f0310bc23d (diff) |
Add latest changes from gitlab-org/security/gitlab@14-4-stable-ee
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/projects_controller_spec.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/controllers/projects_controller_spec.rb b/spec/controllers/projects_controller_spec.rb index 3d966848c5b..b34cfedb767 100644 --- a/spec/controllers/projects_controller_spec.rb +++ b/spec/controllers/projects_controller_spec.rb @@ -323,6 +323,34 @@ RSpec.describe ProjectsController do expect(response).to render_template('_files') expect(response.body).to have_content('LICENSE') # would be 'MIT license' if stub not works end + + describe "PUC highlighting" do + render_views + + before do + expect(controller).to receive(:find_routable!).and_return(public_project) + end + + context "option is enabled" do + it "adds the highlighting class" do + expect(public_project).to receive(:warn_about_potentially_unwanted_characters?).and_return(true) + + get_show + + expect(response.body).to have_css(".project-highlight-puc") + end + end + + context "option is disabled" do + it "doesn't add the highlighting class" do + expect(public_project).to receive(:warn_about_potentially_unwanted_characters?).and_return(false) + + get_show + + expect(response.body).not_to have_css(".project-highlight-puc") + end + end + end end context "when the url contains .atom" do |