File: admin.rb

package info (click to toggle)
ruby-devise-token-authenticatable 0.5.2-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 276 kB
  • sloc: ruby: 1,059; makefile: 2
file content (24 lines) | stat: -rw-r--r-- 529 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FactoryGirl.define do

  factory :admin do
    sequence(:email)      { |n| "admin#{n}@domain.com" }
    password              'some_password'
    password_confirmation 'some_password'

    ignore do
      confirm_account true
    end

    after(:create) do |u, evaluator|
      u.confirm if evaluator.confirm_account
    end

    trait :with_reset_password_token do
      reset_password_token { SecureRandom.hex }
    end

    trait :with_authentication_token do
      authentication_token { SecureRandom.hex }
    end
  end
end