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:
Diffstat (limited to 'spec/helpers/labels_helper_spec.rb')
-rw-r--r--spec/helpers/labels_helper_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/helpers/labels_helper_spec.rb b/spec/helpers/labels_helper_spec.rb
index 90366d7772c..85420d4afda 100644
--- a/spec/helpers/labels_helper_spec.rb
+++ b/spec/helpers/labels_helper_spec.rb
@@ -310,4 +310,15 @@ RSpec.describe LabelsHelper do
end
end
end
+
+ describe '#wrap_label_html' do
+ let(:project) { build_stubbed(:project) }
+ let(:xss_label) do
+ build_stubbed(:label, name: 'xsslabel', project: project, color: '"><img src=x onerror=prompt(1)>')
+ end
+
+ it 'does not include the color' do
+ expect(wrap_label_html('xss', label: xss_label, small: false)).not_to include('color:')
+ end
+ end
end