OSDN Git Service

t#32046:add sheet
[pettanr/pettanr.git] / spec / models / scroll_spec.rb
index 7479689..9128dc7 100644 (file)
@@ -60,6 +60,21 @@ describe Scroll do
         @scroll.should_not be_valid
       end
     end
+    
+    context 'author_idを検証するとき' do
+      it 'nullなら失敗する' do
+        @scroll.author_id = nil
+        @scroll.should_not be_valid
+      end
+      it '数値でなければ失敗する' do
+        @scroll.author_id = 'a'
+        @scroll.should_not be_valid
+      end
+      it '存在する作家でなければ失敗する' do
+        @scroll.author_id = 0
+        @scroll.should_not be_valid
+      end
+    end
   end
   
   describe '文字コード検証に於いて' do