2019-07-30 21:29:24 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-03-25 16:15:39 +00:00
|
|
|
# License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later
|
2018-03-25 17:30:42 +00:00
|
|
|
FactoryBot.define do
|
|
|
|
factory :nonprofit do
|
2019-07-30 21:29:24 +00:00
|
|
|
name { 'spec_nonprofit_full' }
|
2019-01-16 20:33:21 +00:00
|
|
|
city { 'Albuquerque' }
|
|
|
|
state_code { 'NM' }
|
2019-07-30 21:29:24 +00:00
|
|
|
zip_code { 55_555 }
|
|
|
|
email { 'example@email.com' }
|
2019-01-16 20:33:21 +00:00
|
|
|
slug { 'sluggy-sluggo' }
|
2018-03-25 17:30:42 +00:00
|
|
|
|
|
|
|
factory :nonprofit_with_cards do
|
2019-07-30 21:29:24 +00:00
|
|
|
after(:create) do |nonprofit, _evaluator|
|
|
|
|
create(:active_card_1, holder: nonprofit)
|
|
|
|
create(:active_card_2, holder: nonprofit)
|
|
|
|
create(:inactive_card, holder: nonprofit)
|
|
|
|
end
|
2018-03-25 17:30:42 +00:00
|
|
|
end
|
|
|
|
|
2019-07-30 21:29:24 +00:00
|
|
|
after(:create) do |nonprofit, _evaluator|
|
2018-03-25 17:30:42 +00:00
|
|
|
create(:supporter, nonprofit: nonprofit)
|
2019-07-30 21:29:24 +00:00
|
|
|
end
|
2018-03-25 17:30:42 +00:00
|
|
|
end
|
|
|
|
end
|