Fix obsolete finder in MeetingsController

Signed-off-by: Alex Coles <alex@alexbcoles.com>
pull/6827/head
Alex Coles 9 years ago
parent 06edb4832e
commit 8b88eb921f
  1. 4
      app/controllers/meetings_controller.rb
  2. 4
      spec/controllers/meetings_controller_spec.rb

@ -133,7 +133,9 @@ class MeetingsController < ApplicationController
end
def find_meeting
@meeting = Meeting.find(params[:id], include: [:project, :author, { participants: :user }, :agenda, :minutes])
@meeting = Meeting
.includes([:project, :author, { participants: :user }, :agenda, :minutes])
.find(params[:id])
@project = @meeting.project
rescue ActiveRecord::RecordNotFound
render_404

@ -52,7 +52,7 @@ describe MeetingsController, type: :controller do
describe 'show' do
before(:each) do
@m = mock_model(Meeting)
allow(Meeting).to receive(:find).and_return(@m)
allow(Meeting).to receive_message_chain(:includes, :find).and_return(@m)
allow(@m).to receive(:project).and_return(@p)
allow(allow(@m).to receive(:agenda)).to receive(:present?).and_return(false)
end
@ -84,7 +84,7 @@ describe MeetingsController, type: :controller do
describe 'edit' do
before(:each) do
@m = mock_model(Meeting)
allow(Meeting).to receive(:find).and_return(@m)
allow(Meeting).to receive_message_chain(:includes, :find).and_return(@m)
allow(@m).to receive(:project).and_return(@p)
end
describe 'html' do

Loading…
Cancel
Save