OSDN Git Service

t#30220:i18n system error message
[pettanr/pettanr.git] / spec / models / panel_spec.rb
index 15e256b..ea6374b 100644 (file)
@@ -1136,13 +1136,21 @@ describe Panel do
         }.should change(Panel, :count)\r
       end\r
     end\r
+    context '不正なjsonデータのとき' do\r
+      before do\r
+      end\r
+      it 'エラーメッセージがセットされている' do\r
+        r = @panel.store false, @author\r
+        @panel.errors[:base].should_not be_blank\r
+      end\r
+    end\r
     context '従属データの検証に失敗したとき' do\r
       before do\r
         Panel.any_instance.stub(:validate_child).with(any_args).and_return(false)\r
       end\r
       it 'エラーメッセージがセットされている' do\r
         r = @panel.store @attr, @author\r
-        @panel.errors.should_not be_empty\r
+        @panel.errors[:base].should_not be_blank\r
       end\r
     end\r
     context 'カラム値がFalseしたとき' do\r