2022-01-01 13:38:12 +00:00
|
|
|
# Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
|
2021-06-01 12:20:20 +00:00
|
|
|
|
2019-01-22 16:35:01 +00:00
|
|
|
FactoryBot.define do
|
|
|
|
factory :'ticket/state', aliases: %i[ticket_state] do
|
2019-01-25 13:28:15 +00:00
|
|
|
name do
|
|
|
|
# The following line ensures that the name generated by Faker
|
|
|
|
# does not conflict with any existing names in the DB.
|
|
|
|
# There's a special syntax for this
|
|
|
|
# (Faker::Verb.unique.exclude(:past_participle, [], Ticket::State.pluck(:name)),
|
|
|
|
# but it's not available yet in the current release of Faker (1.9.1).
|
|
|
|
Faker::Verb.unique
|
2020-09-30 09:07:01 +00:00
|
|
|
.instance_variable_get(:@previous_results)[[:past_participle, []]]
|
2019-01-25 13:28:15 +00:00
|
|
|
.merge(Ticket::State.pluck(:name))
|
|
|
|
|
|
|
|
Faker::Verb.unique.past_participle
|
|
|
|
end
|
|
|
|
|
2019-01-22 16:35:01 +00:00
|
|
|
association :state_type, factory: :'ticket/state_type'
|
|
|
|
updated_by_id { 1 }
|
|
|
|
created_by_id { 1 }
|
|
|
|
end
|
|
|
|
end
|