role.rb 325 B

123456789101112131415
  1. FactoryBot.define do
  2. factory :role do
  3. sequence(:name) { |n| "TestRole#{n}" }
  4. created_by_id { 1 }
  5. updated_by_id { 1 }
  6. factory :agent_role do
  7. permissions { Permission.where(name: 'ticket.agent') }
  8. end
  9. trait :admin do
  10. permissions { Permission.where(name: 'admin') }
  11. end
  12. end
  13. end