end
end
context 'つつがなく終わるとき' do
- it '削除される' do
- lambda {
- delete :destroy, :id => @rp.id
- }.should change ResourcePicture, :count
+ before do
+ ResourcePicture.any_instance.stub(:unpublish).with(any_args()).and_return(true)
end
context 'html形式' do
- before do
- ResourcePicture.any_instance.stub(:unpublish).with(any_args()).and_return(true)
- end
it 'ステータスコード302 Foundを返す' do
delete :destroy, :id => @rp.id
response.status.should eq 302
end
end
context 'json形式' do
- before do
- ResourcePicture.any_instance.stub(:unpublish).with(any_args()).and_return(true)
- end
it 'ステータスコード200 OKを返す' do
delete :destroy, :id => @rp.id, :format => :json
response.should be_success