+ context '作家が絵師でないとき' do
+ before do
+ Author.any_instance.stub(:artist?).and_return(false)
+ end
+ context 'html形式' do
+ it 'ステータスコード302 Foundを返す' do
+ delete :destroy, :id => @op.id
+ response.status.should eq 302
+ end
+ it '絵師登録ページへ遷移する' do
+ delete :destroy, :id => @op.id
+ response.should redirect_to new_artist_path
+ end
+ end
+ context 'json形式' do
+ it '応答メッセージにUnauthorizedを返す' do
+ delete :destroy, :id => @op.id, :format => :json
+ response.message.should match(/Unauthorized/)
+ end
+ end
+ end