stbaldricks 12.9.0 → 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 +87 -281
- 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,15 +0,0 @@
|
|
1
|
-
require_relative '../lib/helpers'
|
2
|
-
|
3
|
-
FactoryBot.define do
|
4
|
-
factory :team_rankings, class: SBF::Client::Team::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(:event=, build(:team_rankings_ranking)) if unpopulated?(evaluator, :event)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
data/spec/factories/team.rb
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
require_relative 'lib/helpers'
|
2
|
-
|
3
|
-
FactoryBot.define do
|
4
|
-
factory :team, class: SBF::Client::FullTeam do
|
5
|
-
to_create do |it|
|
6
|
-
# Really gross - we don't support team create through the api currently.
|
7
|
-
# Instead we need to use the start_team/move_participant_to_team logic
|
8
|
-
|
9
|
-
# Save the participant first so we can move it
|
10
|
-
raise "Failed to create #{it.class}: #{it.errors.details}" unless it.captain.save
|
11
|
-
|
12
|
-
# Start the team using the info from the existing object and the participant we created
|
13
|
-
response = SBF::Client::Participant.start_team(it.captain.id, it.name, it.fundraising_goal)
|
14
|
-
raise "Failed to create #{it.class}: #{it.errors.details}" unless response.success?
|
15
|
-
|
16
|
-
p = response.data
|
17
|
-
raise "Failed to create #{it.class}: #{it.errors.details}" unless p.is_a?(SBF::Client::Participant)
|
18
|
-
|
19
|
-
# Query the team on the participant that was returned (we are creating a team after all)
|
20
|
-
team_hash = SBF::Client::Team.get(p.team.id).to_hash
|
21
|
-
|
22
|
-
# Gross... find a better way eventually
|
23
|
-
readonly_attributes = %w(display_name photos totals created_at modified_at)
|
24
|
-
readonly_attributes.each { |attr| it.instance_variable_set("@#{attr}".to_sym, team_hash.delete(attr.to_sym)) }
|
25
|
-
|
26
|
-
# Return the new team
|
27
|
-
it.attributes = team_hash.merge(captain: it.captain)
|
28
|
-
end
|
29
|
-
|
30
|
-
initialize_with do
|
31
|
-
new(attributes)
|
32
|
-
end
|
33
|
-
|
34
|
-
name { "#{Faker::Team.name} #{random}" }
|
35
|
-
status { SBF::Client::Team::Status::ACTIVE }
|
36
|
-
fundraising_goal { rand(50) * 500 }
|
37
|
-
fundraising_message { 'We are raising money for SBF' }
|
38
|
-
|
39
|
-
after :build do |team, evaluator|
|
40
|
-
team.captain = build(:team_captain, event: team.event) if unpopulated?(evaluator, :captain)
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
data/spec/factories/user.rb
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
FactoryBot.define do
|
2
|
-
factory :user, class: SBF::Client::User do
|
3
|
-
to_create { |it| raise "Failed to create #{it.class}: #{it.errors.details}" unless it.save }
|
4
|
-
|
5
|
-
initialize_with do
|
6
|
-
new(attributes)
|
7
|
-
end
|
8
|
-
|
9
|
-
type { SBF::Client::User::ProviderType::SBF }
|
10
|
-
access_scope { SBF::Client::User::AccessScope::MEMBER }
|
11
|
-
username { random }
|
12
|
-
password { 'Super123' }
|
13
|
-
end
|
14
|
-
end
|
data/spec/factories/venue.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
require_relative 'lib/helpers'
|
2
|
-
|
3
|
-
FactoryBot.define do
|
4
|
-
factory :venue, class: SBF::Client::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(:location) if unpopulated?(evaluator, :location)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|