role.rb 421 B

12345678910111213141516171819
  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 :customer do
  10. permissions { Permission.where(name: 'ticket.customer') }
  11. end
  12. trait :admin do
  13. permissions { Permission.where(name: 'admin') }
  14. end
  15. end
  16. end