Sha256: e58938a3f9bdad00c33c1336f8fd2be1e328c44e689300947c2e11051f6a03c4

Contents?: true

Size: 1.3 KB

Versions: 2

Compression:

Stored size: 1.3 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 :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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
saucy-0.6.1 lib/generators/saucy/features/templates/factories.rb
saucy-0.6.0 lib/generators/saucy/features/templates/factories.rb