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