OSDN Git Service

t#29061/t#29089/t#29076:add mylist. modify panel picture
[pettanr/pettanr.git] / spec / models / speech_spec.rb
index 2b22724..f54f225 100644 (file)
@@ -3,27 +3,27 @@ require 'spec_helper'
 \r
 describe Speech do\r
   before do\r
-    Factory :admin\r
-    @sp = Factory :system_picture
-    @lg = Factory :license_group
-    @l = Factory :license, :license_group_id => @lg.id, :system_picture_id => @sp.id
-    @user = Factory( :user_yas)\r
+    FactoryGirl.create :admin\r
+    @sp = FactoryGirl.create :system_picture
+    @lg = FactoryGirl.create :license_group
+    @l = FactoryGirl.create :license, :license_group_id => @lg.id, :system_picture_id => @sp.id
+    @user = FactoryGirl.create( :user_yas)\r
     @author = @user.author\r
     \r
-    @panel = Factory :panel\r
-    @speech_balloon_template = Factory :speech_balloon_template\r
-    @speech_balloon = Factory :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id\r
+    @panel = FactoryGirl.create :panel\r
+    @speech_balloon_template = FactoryGirl.create :speech_balloon_template\r
+    @speech_balloon = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id\r
   end\r
   \r
   describe '検証に於いて' do\r
     it 'オーソドックスなデータなら通る' do\r
-      @speech = Factory.build :speech, :speech_balloon_id => @speech_balloon.id\r
+      @speech = FactoryGirl.build :speech, :speech_balloon_id => @speech_balloon.id\r
       @speech.should be_valid\r
     end\r
     \r
     context 'speech_balloon_idを検証するとき' do\r
       before do\r
-        @speech = Factory.build :speech, :speech_balloon_id => @speech_balloon.id\r
+        @speech = FactoryGirl.build :speech, :speech_balloon_id => @speech_balloon.id\r
       end\r
       #ネストの保存はnilを許可しなければならないので数値チェックだけ
       it 'テストデータの確認' do\r
@@ -39,7 +39,7 @@ describe Speech do
     end\r
     context 'xを検証するとき' do\r
       before do\r
-        @speech = Factory.build :speech, :speech_balloon_id => @speech_balloon.id\r
+        @speech = FactoryGirl.build :speech, :speech_balloon_id => @speech_balloon.id\r
       end\r
       it 'テストデータの確認' do\r
         @speech.x = '1'\r
@@ -64,7 +64,7 @@ describe Speech do
     end\r
     context 'yを検証するとき' do\r
       before do\r
-        @speech = Factory.build :speech, :speech_balloon_id => @speech_balloon.id\r
+        @speech = FactoryGirl.build :speech, :speech_balloon_id => @speech_balloon.id\r
       end\r
       it 'テストデータの確認' do\r
         @speech.y = '1'\r
@@ -89,7 +89,7 @@ describe Speech do
     end\r
     context 'widthを検証するとき' do\r
       before do\r
-        @speech = Factory.build :speech, :speech_balloon_id => @speech_balloon.id\r
+        @speech = FactoryGirl.build :speech, :speech_balloon_id => @speech_balloon.id\r
       end\r
       it 'テストデータの確認' do\r
         @speech.width = 1\r
@@ -114,7 +114,7 @@ describe Speech do
     end\r
     context 'heightを検証するとき' do\r
       before do\r
-        @speech = Factory.build :speech, :speech_balloon_id => @speech_balloon.id\r
+        @speech = FactoryGirl.build :speech, :speech_balloon_id => @speech_balloon.id\r
       end\r
       it 'テストデータの確認' do\r
         @speech.height = '1'\r
@@ -139,7 +139,7 @@ describe Speech do
     end\r
     context 'settingsを検証するとき' do\r
       before do\r
-        @speech = Factory.build :speech, :speech_balloon_id => @speech_balloon.id\r
+        @speech = FactoryGirl.build :speech, :speech_balloon_id => @speech_balloon.id\r
       end\r
       it 'テストデータの確認' do\r
         @speech.settings = ''\r