state.rb 829 B

12345678910111213141516171819202122
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. FactoryBot.define do
  3. factory :'ticket/state', aliases: %i[ticket_state] do
  4. name do
  5. # The following line ensures that the name generated by Faker
  6. # does not conflict with any existing names in the DB.
  7. # There's a special syntax for this
  8. # (Faker::Verb.unique.exclude(:past_participle, [], Ticket::State.pluck(:name)),
  9. # but it's not available yet in the current release of Faker (1.9.1).
  10. Faker::Verb.unique
  11. .instance_variable_get(:@previous_results)[[:past_participle, []]]
  12. .merge(Ticket::State.pluck(:name))
  13. Faker::Verb.unique.past_participle
  14. end
  15. association :state_type, factory: :'ticket/state_type'
  16. updated_by_id { 1 }
  17. created_by_id { 1 }
  18. end
  19. end