stbaldricks 12.10.0.alpha.1 → 12.10.0.alpha.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/stbaldricks/configuration.rb +2 -2
- data/lib/stbaldricks/default_logger.rb +2 -2
- data/lib/stbaldricks/endpoints/blog_post.rb +8 -8
- data/lib/stbaldricks/endpoints/communicate.rb +1 -1
- data/lib/stbaldricks/endpoints/config.rb +1 -1
- data/lib/stbaldricks/endpoints/deduplicator_match.rb +2 -2
- data/lib/stbaldricks/endpoints/kid.rb +1 -1
- data/lib/stbaldricks/endpoints/lib/entity.rb +13 -11
- data/lib/stbaldricks/endpoints/newsletter_recipient.rb +11 -5
- data/lib/stbaldricks/endpoints/participant.rb +3 -3
- data/lib/stbaldricks/endpoints/photo.rb +5 -4
- data/lib/stbaldricks/endpoints/search.rb +2 -2
- data/lib/stbaldricks/endpoints/user.rb +1 -1
- data/lib/stbaldricks/entities/batch.rb +3 -5
- data/lib/stbaldricks/entities/blog_post.rb +1 -7
- data/lib/stbaldricks/entities/campaign.rb +6 -13
- data/lib/stbaldricks/entities/challenge.rb +4 -6
- data/lib/stbaldricks/entities/challenger.rb +4 -6
- data/lib/stbaldricks/entities/concerns/entity_response_concern.rb +1 -1
- data/lib/stbaldricks/entities/config.rb +3 -8
- data/lib/stbaldricks/entities/contact.rb +4 -7
- data/lib/stbaldricks/entities/contact_group.rb +2 -2
- data/lib/stbaldricks/entities/deduplicator_history.rb +1 -6
- data/lib/stbaldricks/entities/deduplicator_match.rb +4 -7
- data/lib/stbaldricks/entities/disease.rb +2 -5
- data/lib/stbaldricks/entities/document_library.rb +3 -8
- data/lib/stbaldricks/entities/document_library_category.rb +1 -4
- data/lib/stbaldricks/entities/donation.rb +12 -18
- data/lib/stbaldricks/entities/donor.rb +1 -5
- data/lib/stbaldricks/entities/event.rb +32 -43
- data/lib/stbaldricks/entities/event_application.rb +6 -10
- data/lib/stbaldricks/entities/event_donation_summary.rb +2 -5
- data/lib/stbaldricks/entities/event_participant_summary.rb +1 -3
- data/lib/stbaldricks/entities/event_supporter.rb +3 -3
- data/lib/stbaldricks/entities/fund.rb +6 -23
- data/lib/stbaldricks/entities/fundraiser.rb +16 -29
- data/lib/stbaldricks/entities/grant.rb +12 -25
- data/lib/stbaldricks/entities/institution.rb +3 -4
- data/lib/stbaldricks/entities/international_partner.rb +4 -16
- data/lib/stbaldricks/entities/kid.rb +13 -30
- data/lib/stbaldricks/entities/kid_honor.rb +1 -0
- data/lib/stbaldricks/entities/kid_institution.rb +2 -2
- data/lib/stbaldricks/entities/lib/address.rb +3 -6
- data/lib/stbaldricks/entities/lib/alternate_shipping_address.rb +1 -3
- data/lib/stbaldricks/entities/lib/base.rb +47 -39
- data/lib/stbaldricks/entities/lib/collection.rb +2 -2
- data/lib/stbaldricks/entities/lib/email_address.rb +1 -2
- data/lib/stbaldricks/entities/lib/fundraising_page.rb +1 -2
- data/lib/stbaldricks/entities/lib/location.rb +1 -0
- data/lib/stbaldricks/entities/lib/milestone.rb +1 -3
- data/lib/stbaldricks/entities/lib/name.rb +2 -2
- data/lib/stbaldricks/entities/lib/not_implemented_object.rb +1 -1
- data/lib/stbaldricks/entities/lib/permissions.rb +2 -4
- data/lib/stbaldricks/entities/lib/phone.rb +2 -3
- data/lib/stbaldricks/entities/lib/third_party_media.rb +1 -5
- data/lib/stbaldricks/entities/lib/top_level.rb +1 -1
- data/lib/stbaldricks/entities/matching_gift_company.rb +16 -39
- data/lib/stbaldricks/entities/memorial.rb +9 -14
- data/lib/stbaldricks/entities/message.rb +4 -15
- data/lib/stbaldricks/entities/organization.rb +11 -17
- data/lib/stbaldricks/entities/page.rb +6 -15
- data/lib/stbaldricks/entities/participant.rb +18 -28
- data/lib/stbaldricks/entities/participant_donation_summary.rb +2 -4
- data/lib/stbaldricks/entities/person.rb +22 -30
- data/lib/stbaldricks/entities/person_donation_by_year_summary.rb +1 -2
- data/lib/stbaldricks/entities/photo.rb +5 -11
- data/lib/stbaldricks/entities/recurring_gift.rb +10 -18
- data/lib/stbaldricks/entities/response.rb +1 -0
- data/lib/stbaldricks/entities/search.rb +30 -168
- data/lib/stbaldricks/entities/section.rb +1 -4
- data/lib/stbaldricks/entities/shave_schedule.rb +4 -13
- data/lib/stbaldricks/entities/summary.rb +1 -7
- data/lib/stbaldricks/entities/team.rb +12 -16
- data/lib/stbaldricks/entities/team_donation_summary.rb +2 -4
- data/lib/stbaldricks/request.rb +2 -2
- data/lib/stbaldricks/version.rb +1 -1
- metadata +4 -198
- data/lib/stbaldricks_factories.rb +0 -5
- data/spec/factories/address.rb +0 -14
- data/spec/factories/campaign/totals.rb +0 -9
- data/spec/factories/campaign.rb +0 -9
- data/spec/factories/challenge.rb +0 -19
- data/spec/factories/challenger.rb +0 -33
- data/spec/factories/collection.rb +0 -17
- data/spec/factories/contact.rb +0 -18
- data/spec/factories/contact_group.rb +0 -18
- data/spec/factories/diagnosis.rb +0 -12
- data/spec/factories/disease.rb +0 -11
- data/spec/factories/donation/participant.rb +0 -27
- data/spec/factories/donation.rb +0 -68
- data/spec/factories/donor.rb +0 -13
- data/spec/factories/email_address.rb +0 -11
- data/spec/factories/error.rb +0 -9
- data/spec/factories/event/coach_tracking/coaching_interactions.rb +0 -12
- data/spec/factories/event/coach_tracking/plaque.rb +0 -12
- data/spec/factories/event/coach_tracking/proceeds.rb +0 -12
- data/spec/factories/event/coach_tracking.rb +0 -18
- data/spec/factories/event/contacts/contact.rb +0 -17
- data/spec/factories/event/contacts/name_pieces.rb +0 -12
- data/spec/factories/event/contacts.rb +0 -16
- data/spec/factories/event/photos.rb +0 -12
- data/spec/factories/event/totals.rb +0 -15
- data/spec/factories/event/venue/location.rb +0 -18
- data/spec/factories/event/venue/social.rb +0 -16
- data/spec/factories/event/venue.rb +0 -16
- data/spec/factories/event.rb +0 -66
- data/spec/factories/event_application.rb +0 -34
- data/spec/factories/event_supporter.rb +0 -19
- data/spec/factories/fund.rb +0 -18
- data/spec/factories/fundraiser/photos.rb +0 -12
- data/spec/factories/fundraiser/policies.rb +0 -11
- data/spec/factories/fundraiser/totals.rb +0 -11
- data/spec/factories/fundraiser.rb +0 -24
- data/spec/factories/fundraising_page.rb +0 -29
- data/spec/factories/grant.rb +0 -22
- data/spec/factories/grant_institution.rb +0 -17
- data/spec/factories/institution.rb +0 -18
- data/spec/factories/kid/custom_institution.rb +0 -12
- data/spec/factories/kid.rb +0 -68
- data/spec/factories/kid_honor.rb +0 -16
- data/spec/factories/kid_institution.rb +0 -23
- data/spec/factories/lib/faker_patch.rb +0 -27
- data/spec/factories/lib/helpers.rb +0 -7
- data/spec/factories/location.rb +0 -17
- data/spec/factories/memorial/photos.rb +0 -14
- data/spec/factories/memorial/totals.rb +0 -11
- data/spec/factories/memorial/tribute.rb +0 -19
- data/spec/factories/memorial.rb +0 -22
- data/spec/factories/message.rb +0 -31
- data/spec/factories/milestone.rb +0 -15
- data/spec/factories/name_pieces.rb +0 -24
- data/spec/factories/newsletter_recipient.rb +0 -13
- data/spec/factories/organization/addresses.rb +0 -16
- data/spec/factories/organization/email_addresses.rb +0 -14
- data/spec/factories/organization/phone_numbers.rb +0 -14
- data/spec/factories/organization.rb +0 -34
- data/spec/factories/page.rb +0 -5
- data/spec/factories/participant/photos.rb +0 -14
- data/spec/factories/participant/policies.rb +0 -12
- data/spec/factories/participant/rankings/ranking.rb +0 -12
- data/spec/factories/participant/rankings.rb +0 -16
- data/spec/factories/participant/roles/role.rb +0 -154
- data/spec/factories/participant/roles.rb +0 -37
- data/spec/factories/participant/totals.rb +0 -11
- data/spec/factories/participant.rb +0 -95
- data/spec/factories/payment.rb +0 -13
- data/spec/factories/permissions.rb +0 -12
- data/spec/factories/person/addresses.rb +0 -16
- data/spec/factories/person/email_addresses.rb +0 -14
- data/spec/factories/person/phone_numbers.rb +0 -14
- data/spec/factories/person/policies.rb +0 -13
- data/spec/factories/person.rb +0 -22
- data/spec/factories/phone.rb +0 -11
- data/spec/factories/photo.rb +0 -11
- data/spec/factories/photos.rb +0 -9
- data/spec/factories/recurring_gift.rb +0 -22
- data/spec/factories/researcher.rb +0 -15
- data/spec/factories/response.rb +0 -38
- data/spec/factories/search_event.rb +0 -19
- data/spec/factories/search_fundraiser.rb +0 -15
- data/spec/factories/search_kid.rb +0 -13
- data/spec/factories/search_participant.rb +0 -15
- data/spec/factories/search_team.rb +0 -13
- data/spec/factories/shave_schedule/time_selection_permissions.rb +0 -12
- data/spec/factories/shave_schedule.rb +0 -33
- data/spec/factories/team/photos.rb +0 -12
- data/spec/factories/team/rankings/ranking.rb +0 -12
- data/spec/factories/team/rankings.rb +0 -15
- data/spec/factories/team/totals.rb +0 -14
- data/spec/factories/team.rb +0 -43
- data/spec/factories/third_party_media.rb +0 -12
- data/spec/factories/treatment_status.rb +0 -10
- data/spec/factories/user.rb +0 -14
- data/spec/factories/venue.rb +0 -15
@@ -1,12 +0,0 @@
|
|
1
|
-
FactoryBot.define do
|
2
|
-
factory :event_coach_tracking_proceeds, class: SBF::Client::Event::CoachTracking::Proceeds do
|
3
|
-
skip_create
|
4
|
-
|
5
|
-
initialize_with do
|
6
|
-
new(attributes)
|
7
|
-
end
|
8
|
-
|
9
|
-
received_date { Time.now.to_s }
|
10
|
-
notification_email_sent_date { Time.now.to_s }
|
11
|
-
end
|
12
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
FactoryBot.define do
|
2
|
-
factory :event_coach_tracking, class: SBF::Client::Event::CoachTracking do
|
3
|
-
skip_create
|
4
|
-
|
5
|
-
initialize_with do
|
6
|
-
new(attributes)
|
7
|
-
end
|
8
|
-
|
9
|
-
host_agreement_date { Time.now.to_s }
|
10
|
-
activated_date { Time.now.to_s }
|
11
|
-
|
12
|
-
after :build do |coach_tracking, _evaluator|
|
13
|
-
coach_tracking.proceeds = build(:event_coach_tracking_proceeds)
|
14
|
-
coach_tracking.coaching_interactions = build(:event_coach_tracking_coaching_interactions)
|
15
|
-
coach_tracking.plaque = build(:event_coach_tracking_plaque)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
require_relative '../../lib/helpers'
|
2
|
-
|
3
|
-
FactoryBot.define do
|
4
|
-
factory :event_contact, class: SBF::Client::Event::Contacts::Contact do
|
5
|
-
skip_create
|
6
|
-
|
7
|
-
initialize_with do
|
8
|
-
new(attributes)
|
9
|
-
end
|
10
|
-
|
11
|
-
after :build do |contact, evaluator|
|
12
|
-
contact.name_pieces = build(:event_contact_name_pieces) if unpopulated?(evaluator, :name_pieces)
|
13
|
-
contact.phone = build(:phone) if unpopulated?(evaluator, :phone)
|
14
|
-
contact.email_address = build(:email_address) if unpopulated?(evaluator, :email_address)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
require_relative '../lib/helpers'
|
2
|
-
|
3
|
-
FactoryBot.define do
|
4
|
-
factory :event_contacts, class: SBF::Client::Event::Contacts do
|
5
|
-
skip_create
|
6
|
-
|
7
|
-
initialize_with do
|
8
|
-
new(attributes)
|
9
|
-
end
|
10
|
-
|
11
|
-
after :build do |contacts, evaluator|
|
12
|
-
contacts.primary = build(:event_contact) if unpopulated?(evaluator, :primary)
|
13
|
-
contacts.secondary = build(:event_contact) if unpopulated?(evaluator, :secondary)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
FactoryBot.define do
|
2
|
-
factory :event_totals, class: SBF::Client::Event::Totals do
|
3
|
-
skip_create
|
4
|
-
|
5
|
-
initialize_with do
|
6
|
-
new(attributes)
|
7
|
-
end
|
8
|
-
|
9
|
-
fundraisers { 1 }
|
10
|
-
participants { 8 }
|
11
|
-
shavees { 5 }
|
12
|
-
teams { 2 }
|
13
|
-
amount_raised { 100 }
|
14
|
-
end
|
15
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
require_relative '../../lib/helpers'
|
2
|
-
|
3
|
-
FactoryBot.define do
|
4
|
-
factory :event_venue_location, class: SBF::Client::Event::Venue::Location do
|
5
|
-
skip_create
|
6
|
-
|
7
|
-
initialize_with do
|
8
|
-
new(attributes)
|
9
|
-
end
|
10
|
-
|
11
|
-
type { SBF::Client::Event::Venue::Location::Type::OTHER }
|
12
|
-
name { Faker::University.name }
|
13
|
-
|
14
|
-
after :build do |location, evaluator|
|
15
|
-
location.address = build(:address) if unpopulated?(evaluator, :address)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
require_relative '../../lib/helpers'
|
2
|
-
|
3
|
-
FactoryBot.define do
|
4
|
-
factory :event_venue_social, class: SBF::Client::Event::Venue::Social do
|
5
|
-
skip_create
|
6
|
-
|
7
|
-
initialize_with do
|
8
|
-
new(attributes)
|
9
|
-
end
|
10
|
-
|
11
|
-
after :build do |social, evaluator|
|
12
|
-
social.facebook_url = "https://www.facebook.com/#{Faker::Internet.slug}" if unpopulated?(evaluator, :facebook_url)
|
13
|
-
social.twitter_name = "@#{Faker::Twitter.screen_name.slice(0, 14)}" if unpopulated?(evaluator, :twitter_name)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
require_relative '../lib/helpers'
|
2
|
-
|
3
|
-
FactoryBot.define do
|
4
|
-
factory :event_venue, class: SBF::Client::Event::Venue do
|
5
|
-
skip_create
|
6
|
-
|
7
|
-
initialize_with do
|
8
|
-
new(attributes)
|
9
|
-
end
|
10
|
-
|
11
|
-
after :build do |venue, evaluator|
|
12
|
-
venue.location = build(:event_venue_location) if unpopulated?(evaluator, :location)
|
13
|
-
venue.social = build(:event_venue_social) if unpopulated?(evaluator, :social)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
data/spec/factories/event.rb
DELETED
@@ -1,66 +0,0 @@
|
|
1
|
-
require_relative 'lib/helpers'
|
2
|
-
|
3
|
-
FactoryBot.define do
|
4
|
-
factory :event, class: SBF::Client::FullEvent do
|
5
|
-
to_create { |it| raise "Failed to create #{it.class}: #{it.errors.details}" unless it.save }
|
6
|
-
|
7
|
-
initialize_with do
|
8
|
-
new(attributes)
|
9
|
-
end
|
10
|
-
|
11
|
-
event_title { "#{Faker::Team.name} #{random}" }
|
12
|
-
year { Time.now.year }
|
13
|
-
date { Time.now.to_s }
|
14
|
-
fund_relationship_type { 'no_association' }
|
15
|
-
status { 'active' }
|
16
|
-
type { 'head_shaving' }
|
17
|
-
sub_type { 'community' }
|
18
|
-
how_created { 'admin_control_panel' }
|
19
|
-
fundraising_goal { rand(20) * 5000 }
|
20
|
-
is_private { false }
|
21
|
-
|
22
|
-
after :build do |event, evaluator|
|
23
|
-
event.venue = build(:event_venue) if unpopulated?(evaluator, :venue)
|
24
|
-
event.contacts = build(:event_contacts) if unpopulated?(evaluator, :contacts)
|
25
|
-
event.organizers = [build(:lead_organizer, person: build(:person))] if unpopulated?(evaluator, :organizers)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
factory :event_activity, class: SBF::Client::Event::Activity do
|
30
|
-
skip_create
|
31
|
-
|
32
|
-
initialize_with do
|
33
|
-
new(attributes)
|
34
|
-
end
|
35
|
-
|
36
|
-
start_time { '12:00:00' }
|
37
|
-
end_time { '14:00:00' }
|
38
|
-
activity { random }
|
39
|
-
sort_order { 1 }
|
40
|
-
end
|
41
|
-
factory :past_event, class: SBF::Client::FullEvent do
|
42
|
-
to_create { |it| raise "Failed to create #{it.class}: #{it.errors.details}" unless it.create }
|
43
|
-
|
44
|
-
initialize_with do
|
45
|
-
new(attributes)
|
46
|
-
end
|
47
|
-
|
48
|
-
id { rand(1000) }
|
49
|
-
event_title { "#{Faker::Team.name} #{random}" }
|
50
|
-
year { Time.now.year - 5 }
|
51
|
-
date { Time.now.to_s }
|
52
|
-
fund_relationship_type { 'no_association' }
|
53
|
-
status { 'active' }
|
54
|
-
type { 'head_shaving' }
|
55
|
-
sub_type { 'community' }
|
56
|
-
how_created { 'admin_control_panel' }
|
57
|
-
fundraising_goal { rand(20) * 5000 }
|
58
|
-
is_private { false }
|
59
|
-
|
60
|
-
after :build do |event, evaluator|
|
61
|
-
event.venue = build(:event_venue) if unpopulated?(evaluator, :venue)
|
62
|
-
event.contacts = build(:event_contacts) if unpopulated?(evaluator, :contacts)
|
63
|
-
event.organizers = [build(:lead_organizer, person: build(:person))] if unpopulated?(evaluator, :organizers)
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
@@ -1,34 +0,0 @@
|
|
1
|
-
require_relative 'lib/helpers'
|
2
|
-
|
3
|
-
FactoryBot.define do
|
4
|
-
factory :event_application, class: SBF::Client::EventApplication do
|
5
|
-
to_create { |it| raise "Failed to create #{it.class}: #{it.errors.details}" unless it.save }
|
6
|
-
|
7
|
-
initialize_with do
|
8
|
-
new(attributes)
|
9
|
-
end
|
10
|
-
|
11
|
-
requested_event_title { "Event Title #{random}" }
|
12
|
-
|
13
|
-
after :build do |event_application, evaluator|
|
14
|
-
event_application.requestor = build(:requestor) if unpopulated?(evaluator, :requestor)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
factory :requestor, class: SBF::Client::EventApplication::Requestor do
|
19
|
-
skip_create
|
20
|
-
|
21
|
-
initialize_with do
|
22
|
-
new(attributes)
|
23
|
-
end
|
24
|
-
|
25
|
-
name { Faker::Name.name }
|
26
|
-
|
27
|
-
after :build do |requestor, evaluator|
|
28
|
-
requestor.name_pieces = build(:name_pieces) if unpopulated?(evaluator, :name_pieces)
|
29
|
-
requestor.email_address = build(:email_address) if unpopulated?(evaluator, :email_address)
|
30
|
-
requestor.phone = build(:phone) if unpopulated?(evaluator, :phone)
|
31
|
-
requestor.address = build(:address) if unpopulated?(evaluator, :address)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
require_relative 'lib/helpers'
|
2
|
-
|
3
|
-
FactoryBot.define do
|
4
|
-
factory :event_supporter, class: SBF::Client::FullEventSupporter do
|
5
|
-
to_create { |it| raise "Failed to create #{it.class}: #{it.errors.details}" unless it.save }
|
6
|
-
|
7
|
-
initialize_with do
|
8
|
-
new(attributes)
|
9
|
-
end
|
10
|
-
|
11
|
-
name { "Supporter #{random}" }
|
12
|
-
url { Faker::Internet.url }
|
13
|
-
sort_order { 1 }
|
14
|
-
|
15
|
-
after :build do |event_supporter, evaluator|
|
16
|
-
event_supporter.event = build(:event) if unpopulated?(evaluator, :event)
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
data/spec/factories/fund.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
require_relative 'lib/helpers'
|
2
|
-
|
3
|
-
FactoryBot.define do
|
4
|
-
factory :fund, class: SBF::Client::FullFund do
|
5
|
-
to_create { |it| raise "Failed to create #{it.class}: #{it.errors.details}" unless it.save }
|
6
|
-
|
7
|
-
initialize_with do
|
8
|
-
new(attributes)
|
9
|
-
end
|
10
|
-
|
11
|
-
name { Faker::University.greek_organization }
|
12
|
-
disabled { false }
|
13
|
-
|
14
|
-
after :build do |fund, evaluator|
|
15
|
-
fund.fundraising_page = build(:fundraising_page) if unpopulated?(evaluator, :fundraising_page)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
require_relative 'lib/helpers'
|
2
|
-
|
3
|
-
FactoryBot.define do
|
4
|
-
factory :fundraiser, class: SBF::Client::FullFundraiser do
|
5
|
-
to_create { |it| raise "Failed to create #{it.class}: #{it.errors.details}" unless it.save }
|
6
|
-
|
7
|
-
initialize_with do
|
8
|
-
new(attributes)
|
9
|
-
end
|
10
|
-
|
11
|
-
status { 'active' }
|
12
|
-
fundraising_goal { 100 }
|
13
|
-
title { "#{Faker::University.greek_organization} #{random}" }
|
14
|
-
start_date { Date.today.to_s }
|
15
|
-
|
16
|
-
after :build do |fundraiser, evaluator|
|
17
|
-
fundraiser.event = SBF::Client::Fundraiser::PartialEvent.new(year: Time.now.year) if unpopulated?(evaluator, :event)
|
18
|
-
fundraiser.owner = build(:person) if unpopulated?(evaluator, :owner)
|
19
|
-
fundraiser.policies = build(:fundraiser_policies) if unpopulated?(evaluator, :policies)
|
20
|
-
fundraiser.venue = build(:venue) if unpopulated?(evaluator, :venue)
|
21
|
-
fundraiser.owner = build(:full_person) if unpopulated?(evaluator, :owner)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
require_relative 'lib/helpers'
|
2
|
-
|
3
|
-
FactoryBot.define do
|
4
|
-
factory :fundraising_page, class: SBF::Client::FundraisingPage do
|
5
|
-
skip_create
|
6
|
-
|
7
|
-
initialize_with do
|
8
|
-
new(attributes)
|
9
|
-
end
|
10
|
-
|
11
|
-
after :build do |fundraising_page, evaluator|
|
12
|
-
fundraising_page.custom_url_segment = random(15) if unpopulated?(evaluator, :custom_url_segment)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
FactoryBot.define do
|
18
|
-
factory :web_page, class: SBF::Client::WebPage do
|
19
|
-
skip_create
|
20
|
-
|
21
|
-
initialize_with do
|
22
|
-
new(attributes)
|
23
|
-
end
|
24
|
-
|
25
|
-
after :build do |web_page, evaluator|
|
26
|
-
web_page.custom_url_segment = random(15) if unpopulated?(evaluator, :custom_url_segment)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
data/spec/factories/grant.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
require_relative 'lib/helpers'
|
2
|
-
|
3
|
-
FactoryBot.define do
|
4
|
-
factory :grant, class: SBF::Client::FullGrant do
|
5
|
-
to_create { |it| raise "Failed to create #{it.class}: #{it.errors.details}" unless it.save }
|
6
|
-
|
7
|
-
initialize_with do
|
8
|
-
new(attributes)
|
9
|
-
end
|
10
|
-
|
11
|
-
sequence(:name) { |n| "Display Name #{n}" }
|
12
|
-
funding_begin_date { Time.now.to_s }
|
13
|
-
funding_end_date { Time.now.to_s }
|
14
|
-
funding_type { SBF::Client::Grant::PartialFundingType.new(id: 1) }
|
15
|
-
web_message { 'This grant supports research staff who' }
|
16
|
-
|
17
|
-
after :build do |grant, evaluator|
|
18
|
-
grant.researcher = build(:researcher) if unpopulated?(evaluator, :researcher)
|
19
|
-
grant.institution = build(:grant_institution) if unpopulated?(evaluator, :institution)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
require_relative 'lib/helpers'
|
2
|
-
|
3
|
-
FactoryBot.define do
|
4
|
-
factory :grant_institution, class: SBF::Client::Grant::FullInstitution do
|
5
|
-
to_create { |it| raise "Failed to create #{it.class}: #{it.errors.details}" unless it.save }
|
6
|
-
|
7
|
-
initialize_with do
|
8
|
-
new(attributes)
|
9
|
-
end
|
10
|
-
|
11
|
-
name { 'El Paso Children\'s Hospital' }
|
12
|
-
|
13
|
-
after :build do |grant_institution, evaluator|
|
14
|
-
grant_institution.send(:address=, build(:address)) if unpopulated?(evaluator, :address)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
require_relative 'lib/helpers'
|
2
|
-
|
3
|
-
FactoryBot.define do
|
4
|
-
# This is system institutions object
|
5
|
-
factory :institution, class: SBF::Client::FullInstitution do
|
6
|
-
to_create { |it| raise "Failed to create #{it.class}: #{it.errors.details}" unless it.save }
|
7
|
-
|
8
|
-
initialize_with do
|
9
|
-
new(attributes)
|
10
|
-
end
|
11
|
-
|
12
|
-
name { "Institution #{random}" }
|
13
|
-
|
14
|
-
after :build do |institution, evaluator|
|
15
|
-
institution.address = build(:address, type: SBF::Client::Address::Type::BUSINESS) if unpopulated?(evaluator, :address)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
FactoryBot.define do
|
2
|
-
# This is the custom institition specific to the kid
|
3
|
-
factory :kid_custom_institution, class: SBF::Client::Kid::CustomInstitution do
|
4
|
-
skip_create
|
5
|
-
|
6
|
-
initialize_with do
|
7
|
-
new(attributes)
|
8
|
-
end
|
9
|
-
|
10
|
-
name { "Custom #{Faker::Company.name}" }
|
11
|
-
end
|
12
|
-
end
|
data/spec/factories/kid.rb
DELETED
@@ -1,68 +0,0 @@
|
|
1
|
-
require_relative 'lib/helpers'
|
2
|
-
|
3
|
-
FactoryBot.define do
|
4
|
-
factory :kid, class: SBF::Client::FullKid do
|
5
|
-
to_create do |it|
|
6
|
-
it.relationships.first.person = FactoryBot.create(:person) if it.relationships.first.person.nil?
|
7
|
-
raise "Failed to create #{it.class}: #{it.errors.details}" unless it.save
|
8
|
-
end
|
9
|
-
|
10
|
-
initialize_with do
|
11
|
-
new(attributes)
|
12
|
-
end
|
13
|
-
|
14
|
-
birthday { Faker::Date.birthday(min_age: 5, max_age: 25).to_s }
|
15
|
-
web_message { 'Thank you for supporting me and' }
|
16
|
-
status { 'active' }
|
17
|
-
gender { 'female' }
|
18
|
-
|
19
|
-
after :build do |kid, evaluator|
|
20
|
-
kid.name_pieces = build(:name_pieces) if unpopulated?(evaluator, :name_pieces)
|
21
|
-
kid.address = build(:address) if unpopulated?(evaluator, :address)
|
22
|
-
kid.diagnosis = build(:diagnosis, date: Faker::Date.between(from: kid.birthday, to: DateTime.now).to_s) if unpopulated?(evaluator, :diagnosis)
|
23
|
-
kid.treatment_status = build(:treatment_status) if unpopulated?(evaluator, :treatment_status)
|
24
|
-
kid.web_page = build(:web_page) if unpopulated?(evaluator, :web_page)
|
25
|
-
kid.photos = build(:photos) if unpopulated?(evaluator, :photos)
|
26
|
-
kid.relationships = [build(:kid_submitter)] if unpopulated?(evaluator, :relationships)
|
27
|
-
kid.guardian = build(:guardian) if unpopulated?(evaluator, :guardian)
|
28
|
-
kid.custom_institutions = [] if unpopulated?(evaluator, :custom_institutions)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
factory :kid_relationship, class: SBF::Client::Kid::Relationship do
|
33
|
-
skip_create
|
34
|
-
|
35
|
-
initialize_with do
|
36
|
-
new(attributes)
|
37
|
-
end
|
38
|
-
|
39
|
-
type { SBF::Client::Kid::Relationship::Type::MOTHER }
|
40
|
-
guardian_type { SBF::Client::Kid::Relationship::GuardianType::OTHER }
|
41
|
-
end
|
42
|
-
|
43
|
-
factory :kid_submitter, parent: :kid_relationship do
|
44
|
-
is_submitter { true }
|
45
|
-
|
46
|
-
after :build do |relationship, evaluator|
|
47
|
-
relationship.permissions = {is_editor: true} if unpopulated?(evaluator, :permissions)
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
factory :guardian, class: SBF::Client::Guardian do
|
52
|
-
relationship { SBF::Client::Guardian::RelationshipType::MOTHER }
|
53
|
-
|
54
|
-
after :build do |kid, evaluator|
|
55
|
-
kid.name_pieces = build(:name_pieces) if unpopulated?(evaluator, :name_pieces)
|
56
|
-
kid.email_address = build(:email_address) if unpopulated?(evaluator, :email_address)
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
factory :kid_url, class: SBF::Client::KidURL do
|
61
|
-
skip_create
|
62
|
-
initialize_with do
|
63
|
-
new(attributes)
|
64
|
-
end
|
65
|
-
|
66
|
-
url { Faker::Internet.url }
|
67
|
-
end
|
68
|
-
end
|
data/spec/factories/kid_honor.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
require_relative 'lib/helpers'
|
2
|
-
|
3
|
-
FactoryBot.define do
|
4
|
-
factory :kid_honor, class: SBF::Client::KidHonor do
|
5
|
-
to_create { |it| raise "Failed to create #{it.class}: #{it.errors.details}" unless it.save }
|
6
|
-
|
7
|
-
initialize_with do
|
8
|
-
new(attributes)
|
9
|
-
end
|
10
|
-
|
11
|
-
after :build do |kid_honor, evaluator|
|
12
|
-
kid_honor.kid = build(:kid) if unpopulated?(evaluator, :kid)
|
13
|
-
kid_honor.honorer = build(:fundraiser) if unpopulated?(evaluator, :honorer)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
require_relative 'lib/helpers'
|
2
|
-
|
3
|
-
FactoryBot.define do
|
4
|
-
# This is the relationship object between the kid and system institutions
|
5
|
-
factory :kid_institution, class: SBF::Client::KidInstitution do
|
6
|
-
to_create do |it|
|
7
|
-
raise "Failed to create #{it.class}: #{it.errors.details}" unless it.save
|
8
|
-
end
|
9
|
-
|
10
|
-
initialize_with do
|
11
|
-
new(attributes)
|
12
|
-
end
|
13
|
-
|
14
|
-
after :build do |kid_institution, evaluator|
|
15
|
-
kid_institution.institution = build(:institution) if unpopulated?(evaluator, :institution)
|
16
|
-
end
|
17
|
-
|
18
|
-
before :create do |kid_institution, evaluator|
|
19
|
-
kid_institution.institution = create(:institution) if unpopulated?(evaluator, :institution)
|
20
|
-
kid_institution.kid = create(:kid) if unpopulated?(evaluator, :kid)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
require 'faker'
|
2
|
-
|
3
|
-
module Faker
|
4
|
-
class Name < Base
|
5
|
-
class << self
|
6
|
-
def ascii_last_name
|
7
|
-
loop do
|
8
|
-
name = last_name
|
9
|
-
return name if /^[a-zA-Z]*$/.match?(name)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
module Faker
|
17
|
-
class Address
|
18
|
-
class << self
|
19
|
-
def ascii_city
|
20
|
-
loop do
|
21
|
-
name = city
|
22
|
-
return name if /^[a-zA-Z]*$/.match?(name)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
data/spec/factories/location.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
require_relative 'lib/helpers'
|
2
|
-
|
3
|
-
FactoryBot.define do
|
4
|
-
factory :location, class: SBF::Client::Location do
|
5
|
-
skip_create
|
6
|
-
|
7
|
-
initialize_with do
|
8
|
-
new(attributes)
|
9
|
-
end
|
10
|
-
|
11
|
-
sequence(:name) { |n| "Location #{n}" }
|
12
|
-
|
13
|
-
after :build do |location, evaluator|
|
14
|
-
location.address = build(:address) if unpopulated?(evaluator, :address)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
FactoryBot.define do
|
2
|
-
factory :memorial_photos, class: SBF::Client::Memorial::Photos do
|
3
|
-
skip_create
|
4
|
-
|
5
|
-
initialize_with do
|
6
|
-
new(attributes)
|
7
|
-
end
|
8
|
-
|
9
|
-
avatar { 'avatar.jpg' }
|
10
|
-
default { 'default.jpg' }
|
11
|
-
cover { 'custom_cover.jpg' }
|
12
|
-
cover_original { 'original_cover.jpg' }
|
13
|
-
end
|
14
|
-
end
|