Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-10-27 15:41:41 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-10-27 15:41:41 +0300
commitc1c828ac7f7b3c2e51d81921bbef9d474cd4d0a4 (patch)
tree32fabcdfa49cd8eab122cf5efecb47db6d5e59bf /spec/controllers/projects_controller_spec.rb
parent547a5884d1ab6a22d9fc9ce79e5cf6f0310bc23d (diff)
Add latest changes from gitlab-org/security/gitlab@14-4-stable-ee
Diffstat (limited to 'spec/controllers/projects_controller_spec.rb')
-rw-r--r--spec/controllers/projects_controller_spec.rb28
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