OSDN Git Service

Merge branch 'v05' of git.sourceforge.jp:/gitroot/pettanr/pettanr into v05
[pettanr/pettanr.git] / spec / models / artist_spec.rb
index 6581fd7..a521172 100644 (file)
@@ -49,6 +49,22 @@ describe Artist do
     end
   end
   
+  describe '文字コード検証に於いて' do
+    before do
+      @artist = FactoryGirl.build :artist, :author_id => @author.id
+    end
+    
+    context 'nameを検証するとき' do
+      it 'Shift JISなら失敗する' do
+        @artist.name = "\x83G\x83r\x83]\x83D"
+        lambda{
+          @artist.valid_encode
+        }.should raise_error(Pettanr::BadRequest)
+      end
+    end
+    
+  end
+  
   describe 'デフォルト値補充に於いて' do
     it '名前がno nameになっている' do
       @artist = FactoryGirl.build :artist, :name => nil