OSDN Git Service

t#29045:create overwrite on panel
[pettanr/pettanr.git] / spec / controllers / panels_controller_spec.rb
index 64a6abf..700b236 100644 (file)
@@ -315,6 +315,14 @@ describe PanelsController do
       end\r
     end\r
     context 'つつがなく終わるとき' do\r
+      it 'コマモデルにデフォルト値補充を依頼している' do\r
+        Panel.any_instance.should_receive(:supply_default).exactly(1)\r
+        post :create, :panel => @attr\r
+      end\r
+      it 'コマモデルに上書き補充を依頼している' do\r
+        Panel.any_instance.should_receive(:overwrite).exactly(1)\r
+        post :create, :panel => @attr\r
+      end\r
       it 'モデルに保存依頼する' do\r
         Panel.any_instance.should_receive(:store).exactly(1)\r
         post :create, :panel => @attr\r
@@ -502,6 +510,10 @@ describe PanelsController do
         Panel.should_receive(:show).exactly(1)\r
         put :update, :id => @panel.id, :panel => @attr\r
       end\r
+      it 'コマモデルに上書き補充を依頼している' do\r
+        Panel.any_instance.should_receive(:overwrite).exactly(1)\r
+        put :update, :id => @panel.id, :panel => @attr\r
+      end\r
       it 'モデルに保存依頼する' do\r
         Panel.any_instance.should_receive(:store).exactly(1)\r
         put :update, :id => @panel.id, :panel => @attr\r