Commit 606701ad authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Look for milestone by iid in milestone controller

parent 625fb2f2
...@@ -81,7 +81,7 @@ class Projects::MilestonesController < Projects::ApplicationController ...@@ -81,7 +81,7 @@ class Projects::MilestonesController < Projects::ApplicationController
protected protected
def milestone def milestone
@milestone ||= @project.milestones.find(params[:id]) @milestone ||= @project.milestones.find_by_iid!(params[:id])
end end
def authorize_admin_milestone! def authorize_admin_milestone!
......
...@@ -25,6 +25,7 @@ describe Milestone do ...@@ -25,6 +25,7 @@ describe Milestone do
end end
describe "Validation" do describe "Validation" do
before { subject.stub(set_iid: false) }
it { should validate_presence_of(:title) } it { should validate_presence_of(:title) }
it { should validate_presence_of(:project) } it { should validate_presence_of(:project) }
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