response.message.should match(/Unauthorized/)\r
end\r
end\r
+ context 'json形式' do\r
+ it 'ステータスコード401 Unauthorizedを返す' do\r
+ get :new, :format => :json\r
+ response.status.should eq 401\r
+ end\r
+ it '応答メッセージにUnauthorizedを返す' do\r
+ get :new, :format => :json\r
+ response.message.should match(/Unauthorized/)\r
+ end\r
+ end\r
end\r
end\r
\r
context '事前チェックしておく' do\r
it 'コミックモデルにデフォルト値補充を依頼している' do\r
Comic.any_instance.should_receive(:supply_default).exactly(1)\r
- post :create, :artist => @attr\r
+ post :create, :comic => @attr\r
end\r
it 'コミックモデルにカラム値復元を依頼している' do\r
Comic.any_instance.should_receive(:attributes=).exactly(1)\r
- post :create, :artist => @attr\r
+ post :create, :comic => @attr\r
end\r
it 'コミックモデルに上書き補充を依頼している' do\r
Comic.any_instance.should_receive(:overwrite).exactly(1)\r
- post :create, :artist => @attr\r
+ post :create, :comic => @attr\r
end\r
it 'モデルに保存依頼する' do\r
Comic.any_instance.should_receive(:save).exactly(1)\r
- post :create, :artist => @attr\r
+ post :create, :comic => @attr\r
end\r
end\r
context 'つつがなく終わるとき' do\r