Sha256: 51391e23f361cb8018440cdfd307c49461e27c78df94c2e663d5e70167f029aa
Contents?: true
Size: 732 Bytes
Versions: 12
Compression:
Stored size: 732 Bytes
Contents
FactoryBot.define do factory :user, class: 'Mks::Auth::User' do first_name { FFaker::Name.name } last_name { FFaker::Name.name } email { FFaker::Internet.email } active { true } password { FFaker::Internet.password(min_length=6) } trait :with_role do after(:create) do |user| user.roles << create(:user_role, name: 'role1') end end trait :with_role_and_menus do after(:create) do |user| user.roles << create(:user_role, :with_menus) end end trait :with_roles do after(:create) do |user| user.roles = [create(:user_role, name: 'role1'), create(:user_role, name: 'role2'), create(:user_role, name: 'role3')] end end end end
Version data entries
12 entries across 12 versions & 5 rubygems