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,19 +0,0 @@
|
|
1
|
-
require 'faker'
|
2
|
-
|
3
|
-
FactoryBot.define do
|
4
|
-
factory :memorial_tribute, class: SBF::Client::Memorial::Tribute do
|
5
|
-
skip_create
|
6
|
-
|
7
|
-
initialize_with do
|
8
|
-
new(attributes)
|
9
|
-
end
|
10
|
-
|
11
|
-
# birthday { Faker::Date.between(DateTime.now - 16, DateTime.now - 4).to_s }
|
12
|
-
# date_of_passing { Faker::Date.between(birthday, DateTime.now).to_s }
|
13
|
-
# name { "#{Faker::Name.first_name} #{Faker::Name.ascii_last_name}" }
|
14
|
-
|
15
|
-
birthday { Time.now.to_s }
|
16
|
-
date_of_passing { Time.now.to_s }
|
17
|
-
sequence(:name) { |n| "Name #{n}" }
|
18
|
-
end
|
19
|
-
end
|
data/spec/factories/memorial.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
require_relative 'lib/helpers'
|
2
|
-
|
3
|
-
FactoryBot.define do
|
4
|
-
factory :memorial, class: SBF::Client::FullMemorial 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
|
-
website_message { 'Memorial ipsum dolor sit amet.' }
|
12
|
-
|
13
|
-
after :build do |memorial, evaluator|
|
14
|
-
memorial.photos = build(:memorial_photos) if unpopulated?(evaluator, :photos)
|
15
|
-
memorial.tribute = build(:memorial_tribute) if unpopulated?(evaluator, :tribute)
|
16
|
-
memorial.third_party_media = build(:third_party_media) if unpopulated?(evaluator, :third_party_media)
|
17
|
-
memorial.send(:totals=, build(:memorial_totals)) if unpopulated?(evaluator, :totals)
|
18
|
-
memorial.address = build(:address) if unpopulated?(evaluator, :address)
|
19
|
-
memorial.tribute = build(:tribute) if unpopulated?(evaluator, :tribute)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
data/spec/factories/message.rb
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
require_relative 'lib/helpers'
|
2
|
-
|
3
|
-
FactoryBot.define do
|
4
|
-
factory :message, class: SBF::Client::Message 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
|
-
type { SBF::Client::Message::Type::MEMBERS_COMMUNICATION }
|
12
|
-
status { SBF::Client::Message::Status::SENT }
|
13
|
-
subject { Faker::Lorem.sentence }
|
14
|
-
body { Faker::Lorem.paragraph }
|
15
|
-
|
16
|
-
after :build do |message, evaluator|
|
17
|
-
message.to = [build(:message_recipient)] if unpopulated?(evaluator, :to)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
factory :message_recipient, class: SBF::Client::Message::Recipient do
|
22
|
-
skip_create
|
23
|
-
|
24
|
-
initialize_with do
|
25
|
-
new(attributes)
|
26
|
-
end
|
27
|
-
|
28
|
-
status { SBF::Client::Message::Recipient::Status::UNREAD }
|
29
|
-
email { Faker::Internet.email }
|
30
|
-
end
|
31
|
-
end
|
data/spec/factories/milestone.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'faker'
|
2
|
-
|
3
|
-
FactoryBot.define do
|
4
|
-
factory :milestone, class: SBF::Client::Milestone do
|
5
|
-
skip_create
|
6
|
-
|
7
|
-
initialize_with do
|
8
|
-
new(attributes)
|
9
|
-
end
|
10
|
-
|
11
|
-
description { Faker::Games::Pokemon.move }
|
12
|
-
amount { rand(1..10_000) }
|
13
|
-
icon { rand(1..10) }
|
14
|
-
end
|
15
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
FactoryBot.define do
|
2
|
-
factory :name_pieces, class: SBF::Client::NamePieces do
|
3
|
-
skip_create
|
4
|
-
|
5
|
-
initialize_with do
|
6
|
-
new(attributes)
|
7
|
-
end
|
8
|
-
|
9
|
-
first_name { Faker::Name.first_name }
|
10
|
-
last_name { Faker::Name.ascii_last_name }
|
11
|
-
middle_initial { Faker::Name.middle_name.slice(0, 1) }
|
12
|
-
end
|
13
|
-
|
14
|
-
factory :event_contact_name_pieces, class: SBF::Client::Event::Contacts::NamePieces do
|
15
|
-
skip_create
|
16
|
-
|
17
|
-
initialize_with do
|
18
|
-
new(attributes)
|
19
|
-
end
|
20
|
-
|
21
|
-
first_name { Faker::Name.first_name }
|
22
|
-
last_name { Faker::Name.ascii_last_name }
|
23
|
-
end
|
24
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
FactoryBot.define do
|
2
|
-
factory :newsletter_recipient, class: SBF::Client::NewsletterRecipient do
|
3
|
-
skip_create
|
4
|
-
|
5
|
-
initialize_with do
|
6
|
-
new(attributes)
|
7
|
-
end
|
8
|
-
|
9
|
-
email_address { Faker::Internet.email }
|
10
|
-
first_name { Faker::Name.first_name }
|
11
|
-
last_name { Faker::Name.ascii_last_name }
|
12
|
-
end
|
13
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
require_relative '../lib/helpers'
|
2
|
-
|
3
|
-
FactoryBot.define do
|
4
|
-
factory :organization_addresses, class: SBF::Client::Organization::Addresses do
|
5
|
-
skip_create
|
6
|
-
|
7
|
-
initialize_with do
|
8
|
-
new(attributes)
|
9
|
-
end
|
10
|
-
|
11
|
-
after :build do |addresses, evaluator|
|
12
|
-
addresses.primary = build(:address) if unpopulated?(evaluator, :primary)
|
13
|
-
addresses.secondary = build(:address) if unpopulated?(evaluator, :secondary)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
FactoryBot.define do
|
2
|
-
factory :organization_email_addresses, class: SBF::Client::Organization::EmailAddresses do
|
3
|
-
skip_create
|
4
|
-
|
5
|
-
initialize_with do
|
6
|
-
new(attributes)
|
7
|
-
end
|
8
|
-
|
9
|
-
after :build do |email_addresses|
|
10
|
-
email_addresses.primary = build(:email_address)
|
11
|
-
email_addresses.secondary = build(:email_address)
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
FactoryBot.define do
|
2
|
-
factory :organization_phone_numbers, class: SBF::Client::Organization::PhoneNumbers do
|
3
|
-
skip_create
|
4
|
-
|
5
|
-
initialize_with do
|
6
|
-
new(attributes)
|
7
|
-
end
|
8
|
-
|
9
|
-
after :build do |phone_numbers|
|
10
|
-
phone_numbers.primary = build(:phone)
|
11
|
-
phone_numbers.secondary = build(:phone)
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
@@ -1,34 +0,0 @@
|
|
1
|
-
require_relative 'lib/helpers'
|
2
|
-
|
3
|
-
FactoryBot.define do
|
4
|
-
factory :organization, class: SBF::Client::FullOrganization 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
|
-
name { Faker::Vehicle.manufacture }
|
13
|
-
type { SBF::Client::Person::Type::BUSINESS }
|
14
|
-
|
15
|
-
after :build do |organization, evaluator|
|
16
|
-
organization.email_addresses = build(:organization_email_addresses) if unpopulated?(evaluator, :email_addresses)
|
17
|
-
organization.phone_numbers = build(:organization_phone_numbers) if unpopulated?(evaluator, :phone_numbers)
|
18
|
-
organization.contact = build(:organization_contact) if unpopulated?(evaluator, :contact)
|
19
|
-
organization.addresses = build(:organization_addresses) if unpopulated?(evaluator, :addresses)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
factory :organization_contact, class: SBF::Client::FullOrganization::ContactName do
|
24
|
-
skip_create
|
25
|
-
|
26
|
-
initialize_with do
|
27
|
-
new(attributes)
|
28
|
-
end
|
29
|
-
|
30
|
-
after :build do |contact, evaluator|
|
31
|
-
contact.name_pieces = build(:name_pieces) if unpopulated?(evaluator, :name_pieces)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
data/spec/factories/page.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
FactoryBot.define do
|
2
|
-
factory :participant_photos, class: SBF::Client::Participant::Photos do
|
3
|
-
skip_create
|
4
|
-
|
5
|
-
initialize_with do
|
6
|
-
new(attributes)
|
7
|
-
end
|
8
|
-
|
9
|
-
add_attribute(:before) { 'before.jpg' }
|
10
|
-
add_attribute(:after) { 'after.jpg' }
|
11
|
-
avatar { 'avatar.jpg' }
|
12
|
-
default { 'default.jpg' }
|
13
|
-
end
|
14
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
require_relative '../lib/helpers'
|
2
|
-
|
3
|
-
FactoryBot.define do
|
4
|
-
factory :participant_rankings, class: SBF::Client::Participant::Rankings do
|
5
|
-
skip_create
|
6
|
-
|
7
|
-
initialize_with do
|
8
|
-
new(attributes)
|
9
|
-
end
|
10
|
-
|
11
|
-
after :build do |rankings, evaluator|
|
12
|
-
rankings.send(:team=, build(:participant_rankings_ranking)) if unpopulated?(evaluator, :team)
|
13
|
-
rankings.send(:event=, build(:participant_rankings_ranking)) if unpopulated?(evaluator, :event)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,154 +0,0 @@
|
|
1
|
-
require_relative '../../lib/helpers'
|
2
|
-
|
3
|
-
FactoryBot.define do
|
4
|
-
factory :participant_roles_shavee, class: SBF::Client::Participant::Roles::Shavee do
|
5
|
-
skip_create
|
6
|
-
|
7
|
-
initialize_with do
|
8
|
-
new(attributes)
|
9
|
-
end
|
10
|
-
|
11
|
-
after :build do |role, evaluator|
|
12
|
-
role.status = SBF::Client::Participant::Roles::Status::ACTIVE if unpopulated?(evaluator, :status)
|
13
|
-
role.requested_shavee_packet = false if unpopulated?(evaluator, :requested_shavee_packet)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
factory :participant_roles_event_support_volunteer, class: SBF::Client::Participant::Roles::EventSupportVolunteer do
|
18
|
-
skip_create
|
19
|
-
|
20
|
-
initialize_with do
|
21
|
-
new(attributes)
|
22
|
-
end
|
23
|
-
|
24
|
-
after :build do |role, evaluator|
|
25
|
-
role.status = SBF::Client::Participant::Roles::Status::ACTIVE if unpopulated?(evaluator, :status)
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
factory :participant_roles_individual_fundraiser, class: SBF::Client::Participant::Roles::IndividualFundraiser do
|
30
|
-
skip_create
|
31
|
-
|
32
|
-
initialize_with do
|
33
|
-
new(attributes)
|
34
|
-
end
|
35
|
-
|
36
|
-
after :build do |role, evaluator|
|
37
|
-
role.status = SBF::Client::Participant::Roles::Status::ACTIVE if unpopulated?(evaluator, :status)
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
factory :participant_roles_barber_coordinator, class: SBF::Client::Participant::Roles::BarberCoordinator do
|
42
|
-
skip_create
|
43
|
-
|
44
|
-
initialize_with do
|
45
|
-
new(attributes)
|
46
|
-
end
|
47
|
-
|
48
|
-
after :build do |role, evaluator|
|
49
|
-
role.status = SBF::Client::Participant::Roles::Status::ACTIVE if unpopulated?(evaluator, :status)
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
factory :participant_roles_shavee_recruiter, class: SBF::Client::Participant::Roles::ShaveeRecruiter do
|
54
|
-
skip_create
|
55
|
-
|
56
|
-
initialize_with do
|
57
|
-
new(attributes)
|
58
|
-
end
|
59
|
-
|
60
|
-
after :build do |role, evaluator|
|
61
|
-
role.status = SBF::Client::Participant::Roles::Status::ACTIVE if unpopulated?(evaluator, :status)
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
factory :participant_roles_team_captain, class: SBF::Client::Participant::Roles::TeamCaptain do
|
66
|
-
skip_create
|
67
|
-
|
68
|
-
initialize_with do
|
69
|
-
new(attributes)
|
70
|
-
end
|
71
|
-
|
72
|
-
after :build do |role, evaluator|
|
73
|
-
role.status = SBF::Client::Participant::Roles::Status::ACTIVE if unpopulated?(evaluator, :status)
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
factory :participant_roles_organizer, class: SBF::Client::Participant::Roles::Organizer do
|
78
|
-
skip_create
|
79
|
-
|
80
|
-
initialize_with do
|
81
|
-
new(attributes)
|
82
|
-
end
|
83
|
-
|
84
|
-
after :build do |role, evaluator|
|
85
|
-
role.status = SBF::Client::Participant::Roles::Status::ACTIVE if unpopulated?(evaluator, :status)
|
86
|
-
role.policies = build(:participant_roles_organizer_role_policies) if unpopulated?(evaluator, :policies)
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
factory :participant_roles_treasurer, class: SBF::Client::Participant::Roles::Treasurer do
|
91
|
-
skip_create
|
92
|
-
|
93
|
-
initialize_with do
|
94
|
-
new(attributes)
|
95
|
-
end
|
96
|
-
|
97
|
-
after :build do |role, evaluator|
|
98
|
-
role.status = SBF::Client::Participant::Roles::Status::ACTIVE if unpopulated?(evaluator, :status)
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|
102
|
-
factory :participant_roles_barber, class: SBF::Client::Participant::Roles::Barber do
|
103
|
-
skip_create
|
104
|
-
|
105
|
-
initialize_with do
|
106
|
-
new(attributes)
|
107
|
-
end
|
108
|
-
|
109
|
-
after :build do |role, evaluator|
|
110
|
-
role.status = SBF::Client::Participant::Roles::Status::ACTIVE if unpopulated?(evaluator, :status)
|
111
|
-
role.license = {number: 'License Number', organization: 'License Organization'}
|
112
|
-
role.salon = {name: 'Salon Name', phone: {number: '444-333-8888'}}
|
113
|
-
end
|
114
|
-
end
|
115
|
-
|
116
|
-
factory :participant_roles_lead_treasurer, class: SBF::Client::Participant::Roles::Treasurer do
|
117
|
-
skip_create
|
118
|
-
|
119
|
-
initialize_with do
|
120
|
-
new(attributes)
|
121
|
-
end
|
122
|
-
|
123
|
-
status { SBF::Client::Participant::Roles::Status::ACTIVE }
|
124
|
-
is_lead { true }
|
125
|
-
end
|
126
|
-
|
127
|
-
factory :participant_roles_lead_organizer, class: SBF::Client::Participant::Roles::Organizer do
|
128
|
-
skip_create
|
129
|
-
|
130
|
-
initialize_with do
|
131
|
-
new(attributes)
|
132
|
-
end
|
133
|
-
|
134
|
-
status { SBF::Client::Participant::Roles::Status::ACTIVE }
|
135
|
-
is_lead { true }
|
136
|
-
|
137
|
-
after :build do |organizer, evaluator|
|
138
|
-
organizer.policies = build(:participant_roles_organizer_role_policies) if unpopulated?(evaluator, :policies)
|
139
|
-
end
|
140
|
-
end
|
141
|
-
|
142
|
-
factory :participant_roles_organizer_role_policies, class: SBF::Client::Participant::Roles::Organizer::Policies do
|
143
|
-
skip_create
|
144
|
-
|
145
|
-
initialize_with do
|
146
|
-
new(attributes)
|
147
|
-
end
|
148
|
-
|
149
|
-
agreement_received_date { Time.now.to_s }
|
150
|
-
coaches_questionnaire_received_date { Time.now.to_s }
|
151
|
-
is_revenue_waiver_accepted { true }
|
152
|
-
is_host_agreement_waiver_accepted { true }
|
153
|
-
end
|
154
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
FactoryBot.define do
|
2
|
-
factory :participant_roles, class: SBF::Client::Participant::Roles do
|
3
|
-
skip_create
|
4
|
-
|
5
|
-
initialize_with do
|
6
|
-
new(attributes)
|
7
|
-
end
|
8
|
-
|
9
|
-
transient do
|
10
|
-
shavee { true }
|
11
|
-
event_support_volunteer { nil }
|
12
|
-
individual_fundraiser { nil }
|
13
|
-
shavee_recruiter { nil }
|
14
|
-
team_captain { nil }
|
15
|
-
barber_coordinator { nil }
|
16
|
-
organizer { nil }
|
17
|
-
lead_organizer { nil }
|
18
|
-
treasurer { nil }
|
19
|
-
lead_treasurer { nil }
|
20
|
-
barber { nil }
|
21
|
-
end
|
22
|
-
|
23
|
-
after :build do |roles, evaluator|
|
24
|
-
roles.shavee = build(:participant_roles_shavee) if evaluator.shavee
|
25
|
-
roles.event_support_volunteer = build(:participant_roles_event_support_volunteer) if evaluator.event_support_volunteer
|
26
|
-
roles.individual_fundraiser = build(:participant_roles_individual_fundraiser) if evaluator.individual_fundraiser
|
27
|
-
roles.shavee_recruiter = build(:participant_roles_shavee_recruiter) if evaluator.shavee_recruiter
|
28
|
-
roles.team_captain = build(:participant_roles_team_captain) if evaluator.team_captain
|
29
|
-
roles.barber_coordinator = build(:participant_roles_barber_coordinator) if evaluator.barber_coordinator
|
30
|
-
roles.organizer = build(:participant_roles_lead_organizer) if evaluator.lead_organizer
|
31
|
-
roles.organizer = build(:participant_roles_organizer) if evaluator.organizer
|
32
|
-
roles.treasurer = build(:participant_roles_treasurer) if evaluator.treasurer
|
33
|
-
roles.treasurer = build(:participant_roles_lead_treasurer) if evaluator.lead_treasurer
|
34
|
-
roles.barber = build(:participant_roles_barber) if evaluator.barber
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
@@ -1,95 +0,0 @@
|
|
1
|
-
require_relative 'lib/helpers'
|
2
|
-
|
3
|
-
FactoryBot.define do
|
4
|
-
factory :participant, class: SBF::Client::FullParticipant 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
|
-
fundraising_goal { 100 }
|
12
|
-
shave_time { Time.now.to_s }
|
13
|
-
model_type { 'person' }
|
14
|
-
fundraising_message { 'I am raising money for SBF' }
|
15
|
-
how_created { 'admin_control_panel' }
|
16
|
-
|
17
|
-
after :build do |participant, evaluator|
|
18
|
-
participant.person = build(:person) if unpopulated?(evaluator, :person)
|
19
|
-
if !unpopulated?(evaluator, :event) && evaluator.event.virtual?
|
20
|
-
participant.is_virtual = true
|
21
|
-
participant.shave_schedule = {date: Date.today + 30, time: '12:00:00'} if unpopulated?(evaluator, :shave_schedule)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
factory :lead_organizer, class: SBF::Client::FullParticipant, parent: :participant do
|
27
|
-
after :build do |participant, evaluator|
|
28
|
-
participant.roles = build(:participant_roles, lead_organizer: true, shavee: false) if unpopulated?(evaluator, :roles)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
factory :organizer, class: SBF::Client::FullParticipant, parent: :participant do
|
33
|
-
after :build do |participant, evaluator|
|
34
|
-
participant.roles = build(:participant_roles, organizer: true, shavee: false) if unpopulated?(evaluator, :roles)
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
factory :shavee, class: SBF::Client::FullParticipant, parent: :participant do
|
39
|
-
after :build do |participant, evaluator|
|
40
|
-
participant.roles = build(:participant_roles, shavee: true) if unpopulated?(evaluator, :roles)
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
factory :team_captain, class: SBF::Client::FullParticipant, parent: :participant do
|
45
|
-
after :build do |participant, evaluator|
|
46
|
-
# NOTE: The roles are being ignored on purpose. Do not change this until team create through the api works - and when
|
47
|
-
# that happens we will need to re-write the team factory. Instead we are using the move_participant_to_team route
|
48
|
-
# which will create the roles for us.
|
49
|
-
# participant.roles = build(:participant_roles, team_captain: true, shavee: true) if unpopulated?(evaluator, :roles)
|
50
|
-
participant.roles = build(:participant_roles, team_captain: false, shavee: true) if unpopulated?(evaluator, :roles)
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
factory :shavee_recruiter, class: SBF::Client::FullParticipant, parent: :participant do
|
55
|
-
after :build do |participant, evaluator|
|
56
|
-
participant.roles = build(:participant_roles, shavee_recruiter: true, shavee: false) if unpopulated?(evaluator, :roles)
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
factory :treasurer, class: SBF::Client::FullParticipant, parent: :participant do
|
61
|
-
after :build do |participant, evaluator|
|
62
|
-
participant.roles = build(:participant_roles, treasurer: true, shavee: false) if unpopulated?(evaluator, :roles)
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
factory :lead_treasurer, class: SBF::Client::FullParticipant, parent: :participant do
|
67
|
-
after :build do |participant, evaluator|
|
68
|
-
participant.roles = build(:participant_roles, lead_treasurer: true, shavee: false) if unpopulated?(evaluator, :roles)
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
factory :barber_coordinator, class: SBF::Client::FullParticipant, parent: :participant do
|
73
|
-
after :build do |participant, evaluator|
|
74
|
-
participant.roles = build(:participant_roles, barber_coordinator: true, shavee: false) if unpopulated?(evaluator, :roles)
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
factory :barber, class: SBF::Client::FullParticipant, parent: :participant do
|
79
|
-
after :build do |participant, evaluator|
|
80
|
-
participant.roles = build(:participant_roles, barber: true, shavee: false) if unpopulated?(evaluator, :roles)
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
factory :event_support_volunteer, class: SBF::Client::FullParticipant, parent: :participant do
|
85
|
-
after :build do |participant, evaluator|
|
86
|
-
participant.roles = build(:participant_roles, event_support_volunteer: true, shavee: false) if unpopulated?(evaluator, :roles)
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
factory :individual_fundraiser, class: SBF::Client::FullParticipant, parent: :participant do
|
91
|
-
after :build do |participant, evaluator|
|
92
|
-
participant.roles = build(:participant_roles, individual_fundraiser: true, shavee: false) if unpopulated?(evaluator, :roles)
|
93
|
-
end
|
94
|
-
end
|
95
|
-
end
|
data/spec/factories/payment.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
FactoryBot.define do
|
2
|
-
factory :payment, class: SBF::Client::Payment do
|
3
|
-
skip_create
|
4
|
-
|
5
|
-
initialize_with do
|
6
|
-
new(attributes)
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
factory :subscription_credit_card_payment, class: SBF::Client::Payment::SubscriptionCreditCardDetails, parent: :payment do
|
11
|
-
type { SBF::Client::Payment::Type::CREDIT_CARD }
|
12
|
-
end
|
13
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
require_relative '../lib/helpers'
|
2
|
-
|
3
|
-
FactoryBot.define do
|
4
|
-
factory :person_addresses, class: SBF::Client::Person::Addresses do
|
5
|
-
skip_create
|
6
|
-
|
7
|
-
initialize_with do
|
8
|
-
new(attributes)
|
9
|
-
end
|
10
|
-
|
11
|
-
after :build do |addresses, evaluator|
|
12
|
-
addresses.primary = build(:address) if unpopulated?(evaluator, :primary)
|
13
|
-
addresses.secondary = build(:address) if unpopulated?(evaluator, :secondary)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
FactoryBot.define do
|
2
|
-
factory :person_email_addresses, class: SBF::Client::Person::EmailAddresses do
|
3
|
-
skip_create
|
4
|
-
|
5
|
-
initialize_with do
|
6
|
-
new(attributes)
|
7
|
-
end
|
8
|
-
|
9
|
-
after :build do |email_addresses|
|
10
|
-
email_addresses.primary = build(:email_address)
|
11
|
-
email_addresses.secondary = build(:email_address)
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
FactoryBot.define do
|
2
|
-
factory :person_phone_numbers, class: SBF::Client::Person::PhoneNumbers do
|
3
|
-
skip_create
|
4
|
-
|
5
|
-
initialize_with do
|
6
|
-
new(attributes)
|
7
|
-
end
|
8
|
-
|
9
|
-
after :build do |phone_numbers|
|
10
|
-
phone_numbers.primary = build(:phone)
|
11
|
-
phone_numbers.secondary = build(:phone)
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
FactoryBot.define do
|
2
|
-
factory :policies, class: SBF::Client::Person::Policies do
|
3
|
-
skip_create
|
4
|
-
|
5
|
-
initialize_with do
|
6
|
-
new(attributes)
|
7
|
-
end
|
8
|
-
|
9
|
-
is_photo_policy_accepted { Time.now.to_s }
|
10
|
-
background_check_date { Time.now.to_s }
|
11
|
-
background_check_url { 'http://example.com' }
|
12
|
-
end
|
13
|
-
end
|