Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions spec/factories/agencies.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
FactoryBot.define do
factory :agency do
agency_name_templates = [
'Department of %{industry}',
'Bureau of %{industry}',
'%{industry} Administration',
'%{industry} Agency',
'Department of %{industry} %{tag}',
'Bureau of %{industry} %{tag}',
'%{industry} Administration %{tag}',
'%{industry} Agency %{tag}',
]

id { Agency.last&.id.to_i + 1 } # autoincrementer is messed up for this table
name { format(agency_name_templates.sample, industry: Faker::Company.industry) }
name do
format(agency_name_templates.sample,
industry: Faker::Company.industry,
tag: SecureRandom.hex)
end
end
end