Sha256: 19435944f0effae0176e6abeefaa663c019ad944dc84542a5cb8522a372cde59

Contents?: true

Size: 619 Bytes

Versions: 1

Compression:

Stored size: 619 Bytes

Contents

FactoryGirl.define do

  factory :user do |u|
    sequence(:username) { |n| "user#{n}" }
    password 'secret'
    password_confirmation 'secret'
    first_name 'John'
    last_name 'Smith'
    email "#{:username}@example.com"
    #after_build { |u| u.email ||= "#{u.username}@example.com" }
  end

  factory :email_user , :parent => :user do
    email = :email
  end

  factory :other_named_user, :parent => :user do
    first_name 'Jane'
    last_name 'Doe'
  end

  factory :tuser, :parent => :user do
    last_login_ip '192.168.1.1'
  end

  factory :admin_user, :parent => :user do
    username 'admin'
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
alberich-0.2.0 spec/factories/user.rb