Sha256: 9e13972c32472c09d2c329f472039229cea2964ef2e92da0b5ef90020bbd6f29

Contents?: true

Size: 888 Bytes

Versions: 2

Compression:

Stored size: 888 Bytes

Contents

Factory.sequence :<%= user_singular_name %>_login do |n|
  "user#{n unless n == 1}"
end

Factory.define :<%= user_singular_name %> do |f|
  f.login                   { Factory.next(:<%= user_singular_name %>_login) }
  f.password                { |o| o.login.gsub(/W+/, "_") }
  f.password_confirmation   { |o| o.password }
  f.email                   { |o| o.login.gsub(/W+/, "_") + "@test.com" }
end

# Create factories for additional roles like this:
# 
# Factory.sequence :admin_login do |n|
#   "admin#{n unless n == 1}"
# end
#
# Factory.define :admin, :class => <%= user_class_name %> do |f|
#   f.login                   { Factory.next(:admin_login) }
#   f.password                { |o| o.login.gsub(/W+/, "_") }
#   f.password_confirmation   { |o| o.password }
#   f.email                   { |o| o.login.gsub(/W+/, "_") + "@test.com" }
#   f.admin                   true
# end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
iain-pizza-generators-0.1.3 rails_generators/pizza_authentication/templates/factories.rb
iain-pizza-generators-0.1.4 rails_generators/pizza_authentication/templates/factories.rb