OSDN Git Service

add test
[pettanr/pettanr.git] / spec / factories.rb
index e868120..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,6 +23,12 @@ 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'