OSDN Git Service

t30354#:create mylist for rp
[pettanr/pettanr.git] / spec / controllers / resource_pictures_controller_spec.rb
index 09a0e25..ea53ef7 100644 (file)
@@ -899,15 +899,10 @@ describe ResourcePicturesController do
       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
@@ -918,9 +913,6 @@ describe ResourcePicturesController do
         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