Sha256: d371605ec9235bc15ccb616fa717334d3a1cf4c44a4a9d52748fc89ee1805f9b

Contents?: true

Size: 464 Bytes

Versions: 22

Compression:

Stored size: 464 Bytes

Contents

FactoryBot.define do
  factory :user_role, class: 'Mks::Auth::UserRole' do
    name { FFaker::Name.name }
    association :application_module

    trait :with_menu do
      after(:create) do |role|
        role.menus << create(:menu, text: 'menu1')
      end
    end

    trait :with_menus do
      after(:create) do |role|
        role.menus = [create(:menu, text: 'menu1'), create(:menu, text: 'menu2'), create(:menu, text: 'menu3')]
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 5 rubygems

Version Path
mks_auth-1.0.14 spec/factories/user_roles.rb
mks_rent-1.0.0 spec/factories/user_roles.rb
mks_maintenance-1.0.0 spec/factories/user_roles.rb
mks_rate-1.0.5 spec/factories/user_roles.rb
mks_edm-1.0.5 spec/factories/user_roles.rb
mks_rate-1.0.4 spec/factories/user_roles.rb
mks_edm-1.0.4 spec/factories/user_roles.rb
mks_rate-1.0.3 spec/factories/user_roles.rb
mks_rate-1.0.2 spec/factories/user_roles.rb
mks_edm-1.0.2 spec/factories/user_roles.rb
mks_rate-1.0.1 spec/factories/user_roles.rb
mks_edm-1.0.1 spec/factories/user_roles.rb
mks_auth-1.0.13 spec/factories/user_roles.rb
mks_auth-1.0.12 spec/factories/user_roles.rb
mks_auth-1.0.11 spec/factories/user_roles.rb
mks_auth-1.0.10 spec/factories/user_roles.rb
mks_auth-1.0.9 spec/factories/user_roles.rb
mks_auth-1.0.8 spec/factories/user_roles.rb
mks_auth-1.0.7 spec/factories/user_roles.rb
mks_auth-1.0.6 spec/factories/user_roles.rb