require 'spec_helper'
describe MachineGamesController do
describe 'GET search' do
it 'blah blah' do`
get :search, name: 'some_machine_games'
expect(response).to be_redirected_to(machine_game_path('some_machine_games'))
end
end
上記は、コントローラーのテストに使用する rspec です。また、/spec/controllers/ ディレクトリにも配置されます。私は
NoMethodError:
undefined method `redirected_to?' for #<ActionController::TestResponse:0x007fce065ba640>
誰でも理由を知っていますか?