OSDN Git Service

t#29061/t#29089/t#29076:add mylist. modify panel picture
[pettanr/pettanr.git] / spec / models / original_picture_license_group_spec.rb
index fe98207..fa0dd93 100644 (file)
@@ -4,17 +4,17 @@ require 'spec_helper'
 
 describe OriginalPictureLicenseGroup do
   before do
-    Factory :admin
-    @user = Factory( :user_yas)
+    FactoryGirl.create :admin
+    @user = FactoryGirl.create( :user_yas)
     @author = @user.author
-    @artist = Factory :artist_yas, :author_id => @author.id
-    @other_user = Factory( :user_yas)
+    @artist = FactoryGirl.create :artist_yas, :author_id => @author.id
+    @other_user = FactoryGirl.create( :user_yas)
     @other_author = @other_user.author
-    @other_artist = Factory :artist_yas, :author_id => @other_author.id
-    @sp = Factory :system_picture
-    @lg = Factory :license_group
-    @license = Factory :license, :license_group_id => @lg.id, :system_picture_id => @sp.id
-    @op = Factory :original_picture, :artist_id => @artist.id
+    @other_artist = FactoryGirl.create :artist_yas, :author_id => @other_author.id
+    @sp = FactoryGirl.create :system_picture
+    @lg = FactoryGirl.create :license_group
+    @license = FactoryGirl.create :license, :license_group_id => @lg.id, :system_picture_id => @sp.id
+    @op = FactoryGirl.create :original_picture, :artist_id => @artist.id
   end
   
   describe '検証に於いて' do
@@ -22,13 +22,13 @@ describe OriginalPictureLicenseGroup do
     end
     
     it 'オーソドックスなデータなら通る' do
-      @ol = Factory.build :oplg, :original_picture_id => @op.id, :license_group_id => @lg.id
+      @ol = FactoryGirl.build :oplg, :original_picture_id => @op.id, :license_group_id => @lg.id
       @ol.should be_valid
     end
     
     context 'original_picture_idを検証するとき' do
       before do
-        @ol = Factory.build :oplg, :original_picture_id => @op.id, :license_group_id => @lg.id
+        @ol = FactoryGirl.build :oplg, :original_picture_id => @op.id, :license_group_id => @lg.id
       end
       it 'テストデータの確認' do
         @ol.original_picture_id = @op.id
@@ -49,7 +49,7 @@ describe OriginalPictureLicenseGroup do
     end
     context 'license_group_idを検証するとき' do
       before do
-        @ol = Factory.build :oplg, :original_picture_id => @op.id, :license_group_id => @lg.id
+        @ol = FactoryGirl.build :oplg, :original_picture_id => @op.id, :license_group_id => @lg.id
       end
       it 'テストデータの確認' do
         @ol.license_group_id = @lg.id