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:
authorPatrick Derichs <pderichs@gitlab.com>2019-07-15 14:29:56 +0300
committerPatrick Derichs <pderichs@gitlab.com>2019-08-05 17:01:43 +0300
commit927f608f2c4905e430d2df1c455cec793ef41aa9 (patch)
treed565c908ab14491ef9d5bf161d2e7cd3eaab597b /spec/models/label_spec.rb
parent52b857f119debb5a03c216c4199eb21a49d815b6 (diff)
Fix HTML injection for label description
Add changelog entry Add spec
Diffstat (limited to 'spec/models/label_spec.rb')
-rw-r--r--spec/models/label_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/models/label_spec.rb b/spec/models/label_spec.rb
index c2e2298823e..baf2cfeab0c 100644
--- a/spec/models/label_spec.rb
+++ b/spec/models/label_spec.rb
@@ -84,6 +84,13 @@ describe Label do
end
end
+ describe '#description' do
+ it 'sanitizes description' do
+ label = described_class.new(description: '<b>foo & bar?</b>')
+ expect(label.description).to eq('foo & bar?')
+ end
+ end
+
describe 'priorization' do
subject(:label) { create(:label) }