Commit 840674d1 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets Committed by Robert Speicher

Merge branch 'fix-milestones-with-slashes' into 'master'

Fix Error 500 when global milestones have slashes

* Closes #4226

* Closes https://github.com/gitlabhq/gitlabhq/issues/9921

See merge request !2182
parent e9a2ab11
...@@ -6,6 +6,9 @@ v 8.4.0 (unreleased) ...@@ -6,6 +6,9 @@ v 8.4.0 (unreleased)
- Implement new UI for group page - Implement new UI for group page
- Add project permissions to all project API endpoints (Stan Hu) - Add project permissions to all project API endpoints (Stan Hu)
v 8.3.1 (unreleased)
- Fix Error 500 when global milestones have slashes (Stan Hu)
v 8.3.0 v 8.3.0
- Add CAS support (tduehr) - Add CAS support (tduehr)
- Bump rack-attack to 4.3.1 for security fix (Stan Hu) - Bump rack-attack to 4.3.1 for security fix (Stan Hu)
......
...@@ -16,7 +16,7 @@ class GlobalMilestone ...@@ -16,7 +16,7 @@ class GlobalMilestone
end end
def safe_title def safe_title
@title.to_slug.to_s @title.to_slug.normalize.to_s
end end
def expired? def expired?
......
...@@ -62,4 +62,14 @@ describe GlobalMilestone, models: true do ...@@ -62,4 +62,14 @@ describe GlobalMilestone, models: true do
expect(@global_milestone.milestones.count).to eq(3) expect(@global_milestone.milestones.count).to eq(3)
end end
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 end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment