Sha256: 7943b82273dc3a3814bb71cfd4dfe55889d7bcbcea8f90309d7c5edef58677e7

Contents?: true

Size: 1.74 KB

Versions: 29

Compression:

Stored size: 1.74 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.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

29 entries across 29 versions & 1 rubygems

Version Path
saucy-0.10.10 lib/generators/saucy/features/templates/factories.rb
saucy-0.13.3 lib/generators/saucy/features/templates/factories.rb
saucy-0.13.2 lib/generators/saucy/features/templates/factories.rb
saucy-0.10.9 lib/generators/saucy/features/templates/factories.rb
saucy-0.10.8 lib/generators/saucy/features/templates/factories.rb
saucy-0.13.1 lib/generators/saucy/features/templates/factories.rb
saucy-0.13.0 lib/generators/saucy/features/templates/factories.rb
saucy-0.12.5 lib/generators/saucy/features/templates/factories.rb
saucy-0.12.4 lib/generators/saucy/features/templates/factories.rb
saucy-0.12.3 lib/generators/saucy/features/templates/factories.rb
saucy-0.12.2 lib/generators/saucy/features/templates/factories.rb
saucy-0.12.1 lib/generators/saucy/features/templates/factories.rb
saucy-0.12.0 lib/generators/saucy/features/templates/factories.rb
saucy-0.11.5 lib/generators/saucy/features/templates/factories.rb
saucy-0.11.3 lib/generators/saucy/features/templates/factories.rb
saucy-0.11.2 lib/generators/saucy/features/templates/factories.rb
saucy-0.10.7 lib/generators/saucy/features/templates/factories.rb
saucy-0.10.6 lib/generators/saucy/features/templates/factories.rb
saucy-0.10.5 lib/generators/saucy/features/templates/factories.rb
saucy-0.10.4 lib/generators/saucy/features/templates/factories.rb