summaryrefslogtreecommitdiff
path: root/spec/models/milestone_spec.rb
diff options
context:
space:
mode:
authorFelipe Artur <felipefac@gmail.com>2016-05-04 18:21:57 -0300
committerFelipe Artur <felipefac@gmail.com>2016-05-05 16:37:49 -0300
commitd028863eda8b97f6e4db129ef57f0d3a2130c9b3 (patch)
tree010e2d279ef301b4fa301815c9878983ffb240cf /spec/models/milestone_spec.rb
parentfad7b392dc633fb689e657af8b7fad346ede416e (diff)
downloadgitlab-ce-d028863eda8b97f6e4db129ef57f0d3a2130c9b3.tar.gz
Sanitize milestones and label titlesissue_15394
Diffstat (limited to 'spec/models/milestone_spec.rb')
-rw-r--r--spec/models/milestone_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/models/milestone_spec.rb b/spec/models/milestone_spec.rb
index 72a4ea70228..e2c89a4b3e6 100644
--- a/spec/models/milestone_spec.rb
+++ b/spec/models/milestone_spec.rb
@@ -34,6 +34,14 @@ describe Milestone, models: true do
let(:issue) { create(:issue) }
let(:user) { create(:user) }
+ describe "#title" do
+ let(:milestone) { create(:milestone, title: "<b>test</b>") }
+
+ it "sanitizes title" do
+ expect(milestone.title).to eq("test")
+ end
+ end
+
describe "unique milestone title per project" do
it "shouldn't accept the same title in a project twice" do
new_milestone = Milestone.new(project: milestone.project, title: milestone.title)