3 sequence(:email) { |n| "user#{n}@example.com" }
4 sequence(:display_name) { |n| "User #{n}" }
5 pass_crypt { Digest::MD5.hexdigest("test") }
7 # These attributes are not the defaults, but in most tests we want
8 # a 'normal' user who can log in without being redirected etc.
11 terms_agreed { Time.now.getutc }
14 trait :with_home_location do
15 home_lat { rand(-90.0...90.0) }
16 home_lon { rand(-180.0...180.0) }
28 status { "confirmed" }
32 status { "suspended" }
39 factory :moderator_user do
40 after(:create) do |user, _evaluator|
41 create(:user_role, :role => "moderator", :user => user)
45 factory :administrator_user do
46 after(:create) do |user, _evaluator|
47 create(:user_role, :role => "administrator", :user => user)
51 factory :super_user do
52 after(:create) do |user, _evaluator|
53 UserRole::ALL_ROLES.each do |role|
54 create(:user_role, :role => role, :user => user)