OSDN Git Service

merge v04
[pettanr/pettanr.git] / spec / controllers / panel_pictures_controller_spec.rb
index 5e8d308..6ec4aa4 100644 (file)
@@ -5,17 +5,22 @@ require 'spec_helper'
 describe PanelPicturesController do
   before do
     Factory :admin
-    @license = Factory :license
+    @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)
     @author = @user.author
     @artist = Factory :artist_yas, :author_id => @author.id
-    @op = Factory :original_picture, :artist_id => @artist.id , :license_id => @license.id
-    @rp = Factory :resource_picture, :artist_id => @artist.id , :license_id => @license.id, :original_picture_id => @op.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}
   end
 
   describe '一覧表示に於いて' do
     before do
-      @pp = Factory :panel_picture, :resource_picture_id => @rp.id
+      @pp = Factory :panel_picture, @attr
       sign_in @user
       PanelPicture.stub(:list).and_return([@pp, @pp, @pp])
     end