OSDN Git Service

t#29061/t#29089/t#29076:add mylist. modify panel picture
[pettanr/pettanr.git] / spec / controllers / panel_pictures_controller_spec.rb
index 6ec4aa4..e020153 100644 (file)
@@ -4,23 +4,23 @@ require 'spec_helper'
 
 describe PanelPicturesController do
   before do
-    Factory :admin
-    @sp = Factory :system_picture
-    @lg = Factory :license_group
-    @license = Factory :license, :license_group_id => @lg.id, :system_picture_id => @sp.id
-    @user = Factory( :user_yas)
+    FactoryGirl.create :admin
+    @sp = FactoryGirl.create :system_picture
+    @lg = FactoryGirl.create :license_group
+    @license = FactoryGirl.create :license, :license_group_id => @lg.id, :system_picture_id => @sp.id
+    @user = FactoryGirl.create( :user_yas)
     @author = @user.author
-    @artist = Factory :artist_yas, :author_id => @author.id
-    @op = Factory :original_picture, :artist_id => @artist.id
-    @p = Factory :picture, :original_picture_id => @op.id, :license_id => @license.id, :artist_id => @artist.id
-    @rp = Factory :resource_picture, :artist_id => @artist.id, :license_id => @license.id, :original_picture_id => @op.id, :picture_id => @p.id
-    @panel = Factory :panel, :author_id => @author.id
-    @attr = {:resource_picture_id => @rp.id, :panel_id => @panel.id}
+    @artist = FactoryGirl.create :artist_yas, :author_id => @author.id
+    @op = FactoryGirl.create :original_picture, :artist_id => @artist.id
+    @p = FactoryGirl.create :picture, :original_picture_id => @op.id, :license_id => @license.id, :artist_id => @artist.id
+    @rp = FactoryGirl.create :resource_picture, :artist_id => @artist.id, :license_id => @license.id, :original_picture_id => @op.id, :picture_id => @p.id
+    @panel = FactoryGirl.create :panel, :author_id => @author.id
+    @attr = {:picture_id => @p.id, :panel_id => @panel.id, :width => @p.width, :height => @p.height}
   end
 
   describe '一覧表示に於いて' do
     before do
-      @pp = Factory :panel_picture, @attr
+      @pp = FactoryGirl.create :panel_picture, @attr
       sign_in @user
       PanelPicture.stub(:list).and_return([@pp, @pp, @pp])
     end