Look for milestone by iid in milestone controller

This commit is contained in:
Dmitriy Zaporozhets 2013-08-21 12:22:18 +03:00
parent 625fb2f29d
commit 606701ada4
2 changed files with 2 additions and 1 deletions

View file

@ -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!

View file

@ -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