Sha256: 44424bd676fcb6d688bd68581833bbd8b63672626b6d0cad9ad894d39af47d57

Contents?: true

Size: 1.97 KB

Versions: 10

Compression:

Stored size: 1.97 KB

Contents

Factory.sequence :email do |n|
  "user#{n}@example.com"
end

Factory.sequence :name do |n|
  "name#{n}"
end

Factory.define :user do |user|
  user.name                  { "test user" }
  user.email                 { Factory.next :email }
  user.password              { "password" }
end

Factory.define :account do |f|
  f.name        { Factory.next(:name) }
  f.keyword     { Factory.next(:name) }
  f.association :plan
end

Factory.define :paid_account, :parent => :account do |f|
  f.cardholder_name   { "Ralph Robot"       }
  f.billing_email     { "ralph@example.com" }
  f.card_number       { "4111111111111111"  }
  f.verification_code { "123"               }
  f.expiration_month  { 5                   }
  f.expiration_year   { 2012                }
  f.street_address    { "1 Robo Lane"       }
  f.locality          { "Boston"            }
  f.region            { "MA"                }
  f.postal_code       { "02108"             }
  f.country_name      { "United States of America" }
  f.association :plan, :factory => :paid_plan
end

Factory.define :membership do |f|
  f.association :user
  f.association :account
end

Factory.define :signup do |f|
  f.email                 { Factory.next :email }
  f.password              { "password" }
  f.association           :plan
end

Factory.define :project do |f|
  f.association :account
  f.name        { Factory.next(:name) }
  f.keyword     { Factory.next(:name) }
end

Factory.define :permission do |f|
  f.association :membership
  f.project     {|a| a.association(:project, :account => a.membership.account)}
end

Factory.define :invitation do |f|
  f.email { Factory.next(:email) }
  f.association :account
  f.association :sender, :factory => :user
end

Factory.define :plan do |f|
  f.name 'Free'
end

Factory.define :paid_plan, :parent => :plan do |f|
  f.name 'Paid'
  f.price 1
end

Factory.define :limit do |f|
  f.name        { Factory.next(:name) }
  f.association :plan
end

Factory.define :coupon do |factory|
  factory.name { "RAMEN" }
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
saucy-0.16.1 lib/generators/saucy/features/templates/factories.rb
saucy-0.16.0 lib/generators/saucy/features/templates/factories.rb
saucy-0.15.2 lib/generators/saucy/features/templates/factories.rb
saucy-0.15.1 lib/generators/saucy/features/templates/factories.rb
saucy-0.15.0 lib/generators/saucy/features/templates/factories.rb
saucy-0.14.5 lib/generators/saucy/features/templates/factories.rb
saucy-0.14.3 lib/generators/saucy/features/templates/factories.rb
saucy-0.14.2 lib/generators/saucy/features/templates/factories.rb
saucy-0.14.1 lib/generators/saucy/features/templates/factories.rb
saucy-0.14.0 lib/generators/saucy/features/templates/factories.rb