IntegrationTestにリファラをセットする方法
フレームワークはTest:Unit。
FunctionalTestは既知だったけどIntegrationTestは無知だった。
FunctionalTest
@request.env['HTTP_REFERER'] = '/donuts/new' post :create, :donuts => { ... } assert_redirected_to 'donuts/new'
IntegrationTest
post :create, { :donuts => { ... } }, { 'HTTP_REFERER' => '/donuts/new' } assert_redirected_to 'donuts/new'