Look for milestone by iid in milestone controller
This commit is contained in:
parent
625fb2f29d
commit
606701ada4
2 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue