Sha256: ee6dc6f829d28d2a42d476ea38d5da05f6599882b13fabaffcddf3331b6788c2

Contents?: true

Size: 625 Bytes

Versions: 7

Compression:

Stored size: 625 Bytes

Contents

FactoryBot.define do
  factory :user do
    email { generate(:email) }
    password '123456'
    password_confirmation '123456'

    factory :default_user do
      confirmed_at 1.hour.ago
      first_name Forgery::Name.first_name
      last_name Forgery::Name.last_name

      factory :admin_user do
        user_role_id UserRoleType.admin.id
      end

      factory :redactor_user do
        user_role_id UserRoleType.redactor.id
      end

      factory :moderator_user do
        user_role_id UserRoleType.moderator.id
      end

      factory :inactive_user do
        locked_at Time.current
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ab_admin-0.11.0 lib/generators/ab_admin/install/templates/spec/factories/user_factory.rb
ab_admin-0.10.0 lib/generators/ab_admin/install/templates/spec/factories/user_factory.rb
ab_admin-0.9.0 lib/generators/ab_admin/install/templates/spec/factories/user_factory.rb
ab_admin-0.8.3 lib/generators/ab_admin/install/templates/spec/factories/user_factory.rb
ab_admin-0.8.2 lib/generators/ab_admin/install/templates/spec/factories/user_factory.rb
ab_admin-0.8.1 lib/generators/ab_admin/install/templates/spec/factories/user_factory.rb
ab_admin-0.8.0 lib/generators/ab_admin/install/templates/spec/factories/user_factory.rb