diff options
author | Stan Hu <stanhu@gmail.com> | 2015-12-23 00:15:32 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2015-12-23 00:15:32 +0300 |
commit | 34695569da0526cde82348286da0e68aaa6273e4 (patch) | |
tree | bfb0c541ba6f44dfc407e8b2d09377589643993d /spec | |
parent | 1cf45407d3be9e9767d27e55b6f3e2e0d8dea36f (diff) |
Fix Error 500 when global milestones have slashes
Closes #4226
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/global_milestone_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/models/global_milestone_spec.rb b/spec/models/global_milestone_spec.rb index ba03e6aabd0..197c99cd007 100644 --- a/spec/models/global_milestone_spec.rb +++ b/spec/models/global_milestone_spec.rb @@ -62,4 +62,14 @@ describe GlobalMilestone, models: true do expect(@global_milestone.milestones.count).to eq(3) end end + + describe :safe_title do + let(:milestone) { create(:milestone, title: "git / test", project: project1) } + + it 'should strip out slashes and spaces' do + global_milestone = GlobalMilestone.new(milestone.title, [milestone]) + + expect(global_milestone.safe_title).to eq('git-test') + end + end end |