OSDN Git Service

add test
[pettanr/pettanr.git] / spec / factories.rb
index f8c1941..b654bc6 100644 (file)
@@ -11,6 +11,11 @@ Factory.define :user_yas, :class => User do |user|
 #  user.author Factory(:author_yas)
 end
 
+Factory.define :author, :class => Author do |author|
+  author.name nil
+  author.sequence(:user_id) { |n| n}
+end
+
 Factory.define :author_yas, :class => Author do |author|
   author.name 'yassan'
   author.sequence(:user_id) { |n| n}
@@ -18,12 +23,31 @@ Factory.define :author_yas, :class => Author do |author|
 #  author.artist Factory(:artist_yas)
 end
 
+Factory.define :artist, :class => Artist do |artist|
+  artist.sequence(:email) { |n| "hoge#{n}@gmail.com"}
+  artist.name nil
+#  artist.association :author_yas
+end
+
 Factory.define :artist_yas, :class => Artist do |artist|
   artist.sequence(:email) { |n| "hoge#{n}@gmail.com"}
   artist.name 'yas'
 #  artist.association :author_yas
 end
 
+Factory.define :license, :class => License do |license|
+  license.name 'peta2.5'
+  license.url 'test'
+  license.cc_by 0
+  license.cc_sa 0
+  license.cc_nd 0
+  license.cc_nc 0
+  license.no_resize 0
+  license.no_flip 0
+  license.no_convert 0
+  license.keep_aspect_ratio 0
+end
+
 Factory.define :normal_comic, :class => Comic do |comic|
   comic.title "normal_comic"
   comic.width 100
@@ -60,7 +84,7 @@ Factory.define :original_picture, :class => OriginalPicture do |op|
   op.ext 'png'
   op.width 222
   op.height 111
-  op.fileseze 100000
+  op.filesize 100000
   op.artist_id 1
   op.license_id 1
 end
@@ -69,7 +93,7 @@ Factory.define :resource_picture, :class => ResourcePicture do |rp|
   rp.ext 'png'
   rp.width 222
   rp.height 111
-  rp.fileseze 100000
+  rp.filesize 100000
   rp.artist_id 1
   rp.license_id 1
   rp.original_picture_id 1