stbaldricks 12.12.0 → 12.13.0.alpha.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (175) hide show
  1. checksums.yaml +4 -4
  2. data/lib/stbaldricks/configuration.rb +2 -2
  3. data/lib/stbaldricks/default_logger.rb +2 -2
  4. data/lib/stbaldricks/endpoints/blog_post.rb +8 -8
  5. data/lib/stbaldricks/endpoints/communicate.rb +1 -1
  6. data/lib/stbaldricks/endpoints/config.rb +1 -1
  7. data/lib/stbaldricks/endpoints/deduplicator_match.rb +2 -2
  8. data/lib/stbaldricks/endpoints/kid.rb +1 -1
  9. data/lib/stbaldricks/endpoints/lib/entity.rb +13 -11
  10. data/lib/stbaldricks/endpoints/newsletter_recipient.rb +11 -5
  11. data/lib/stbaldricks/endpoints/participant.rb +3 -3
  12. data/lib/stbaldricks/endpoints/photo.rb +5 -4
  13. data/lib/stbaldricks/endpoints/search.rb +2 -2
  14. data/lib/stbaldricks/endpoints/user.rb +1 -1
  15. data/lib/stbaldricks/entities/batch.rb +3 -5
  16. data/lib/stbaldricks/entities/blog_post.rb +1 -7
  17. data/lib/stbaldricks/entities/campaign.rb +6 -13
  18. data/lib/stbaldricks/entities/challenge.rb +4 -6
  19. data/lib/stbaldricks/entities/challenger.rb +4 -6
  20. data/lib/stbaldricks/entities/concerns/entity_response_concern.rb +1 -1
  21. data/lib/stbaldricks/entities/config.rb +3 -8
  22. data/lib/stbaldricks/entities/contact.rb +4 -7
  23. data/lib/stbaldricks/entities/contact_group.rb +2 -2
  24. data/lib/stbaldricks/entities/deduplicator_history.rb +1 -6
  25. data/lib/stbaldricks/entities/deduplicator_match.rb +4 -7
  26. data/lib/stbaldricks/entities/disease.rb +2 -5
  27. data/lib/stbaldricks/entities/document_library.rb +3 -8
  28. data/lib/stbaldricks/entities/document_library_category.rb +1 -4
  29. data/lib/stbaldricks/entities/donation.rb +12 -18
  30. data/lib/stbaldricks/entities/donor.rb +1 -5
  31. data/lib/stbaldricks/entities/event.rb +32 -43
  32. data/lib/stbaldricks/entities/event_application.rb +6 -10
  33. data/lib/stbaldricks/entities/event_donation_summary.rb +2 -5
  34. data/lib/stbaldricks/entities/event_participant_summary.rb +1 -3
  35. data/lib/stbaldricks/entities/event_supporter.rb +3 -3
  36. data/lib/stbaldricks/entities/fund.rb +6 -23
  37. data/lib/stbaldricks/entities/fundraiser.rb +16 -29
  38. data/lib/stbaldricks/entities/grant.rb +12 -25
  39. data/lib/stbaldricks/entities/institution.rb +3 -4
  40. data/lib/stbaldricks/entities/international_partner.rb +4 -16
  41. data/lib/stbaldricks/entities/kid.rb +11 -28
  42. data/lib/stbaldricks/entities/kid_honor.rb +1 -0
  43. data/lib/stbaldricks/entities/kid_institution.rb +2 -2
  44. data/lib/stbaldricks/entities/lib/address.rb +3 -6
  45. data/lib/stbaldricks/entities/lib/alternate_shipping_address.rb +1 -3
  46. data/lib/stbaldricks/entities/lib/base.rb +47 -39
  47. data/lib/stbaldricks/entities/lib/collection.rb +2 -2
  48. data/lib/stbaldricks/entities/lib/email_address.rb +1 -2
  49. data/lib/stbaldricks/entities/lib/fundraising_page.rb +1 -2
  50. data/lib/stbaldricks/entities/lib/location.rb +1 -0
  51. data/lib/stbaldricks/entities/lib/milestone.rb +1 -3
  52. data/lib/stbaldricks/entities/lib/name.rb +2 -2
  53. data/lib/stbaldricks/entities/lib/not_implemented_object.rb +1 -1
  54. data/lib/stbaldricks/entities/lib/permissions.rb +2 -4
  55. data/lib/stbaldricks/entities/lib/phone.rb +2 -3
  56. data/lib/stbaldricks/entities/lib/third_party_media.rb +1 -5
  57. data/lib/stbaldricks/entities/lib/top_level.rb +1 -1
  58. data/lib/stbaldricks/entities/matching_gift_company.rb +16 -39
  59. data/lib/stbaldricks/entities/memorial.rb +9 -14
  60. data/lib/stbaldricks/entities/message.rb +4 -15
  61. data/lib/stbaldricks/entities/organization.rb +11 -17
  62. data/lib/stbaldricks/entities/page.rb +9 -15
  63. data/lib/stbaldricks/entities/participant.rb +18 -28
  64. data/lib/stbaldricks/entities/participant_donation_summary.rb +2 -4
  65. data/lib/stbaldricks/entities/person.rb +22 -26
  66. data/lib/stbaldricks/entities/person_donation_by_year_summary.rb +1 -2
  67. data/lib/stbaldricks/entities/photo.rb +5 -11
  68. data/lib/stbaldricks/entities/recurring_gift.rb +10 -18
  69. data/lib/stbaldricks/entities/response.rb +1 -0
  70. data/lib/stbaldricks/entities/search.rb +30 -168
  71. data/lib/stbaldricks/entities/section.rb +1 -4
  72. data/lib/stbaldricks/entities/shave_schedule.rb +4 -13
  73. data/lib/stbaldricks/entities/summary.rb +1 -7
  74. data/lib/stbaldricks/entities/team.rb +12 -16
  75. data/lib/stbaldricks/entities/team_donation_summary.rb +2 -4
  76. data/lib/stbaldricks/request.rb +2 -2
  77. data/lib/stbaldricks/version.rb +1 -1
  78. metadata +83 -277
  79. data/lib/stbaldricks_factories.rb +0 -5
  80. data/spec/factories/address.rb +0 -14
  81. data/spec/factories/campaign/totals.rb +0 -9
  82. data/spec/factories/campaign.rb +0 -9
  83. data/spec/factories/challenge.rb +0 -19
  84. data/spec/factories/challenger.rb +0 -33
  85. data/spec/factories/collection.rb +0 -17
  86. data/spec/factories/contact.rb +0 -18
  87. data/spec/factories/contact_group.rb +0 -18
  88. data/spec/factories/diagnosis.rb +0 -12
  89. data/spec/factories/disease.rb +0 -11
  90. data/spec/factories/donation/participant.rb +0 -27
  91. data/spec/factories/donation.rb +0 -68
  92. data/spec/factories/donor.rb +0 -13
  93. data/spec/factories/email_address.rb +0 -11
  94. data/spec/factories/error.rb +0 -9
  95. data/spec/factories/event/coach_tracking/coaching_interactions.rb +0 -12
  96. data/spec/factories/event/coach_tracking/plaque.rb +0 -12
  97. data/spec/factories/event/coach_tracking/proceeds.rb +0 -12
  98. data/spec/factories/event/coach_tracking.rb +0 -18
  99. data/spec/factories/event/contacts/contact.rb +0 -17
  100. data/spec/factories/event/contacts/name_pieces.rb +0 -12
  101. data/spec/factories/event/contacts.rb +0 -16
  102. data/spec/factories/event/photos.rb +0 -12
  103. data/spec/factories/event/totals.rb +0 -15
  104. data/spec/factories/event/venue/location.rb +0 -18
  105. data/spec/factories/event/venue/social.rb +0 -16
  106. data/spec/factories/event/venue.rb +0 -16
  107. data/spec/factories/event.rb +0 -66
  108. data/spec/factories/event_application.rb +0 -34
  109. data/spec/factories/event_supporter.rb +0 -19
  110. data/spec/factories/fund.rb +0 -18
  111. data/spec/factories/fundraiser/photos.rb +0 -12
  112. data/spec/factories/fundraiser/policies.rb +0 -11
  113. data/spec/factories/fundraiser/totals.rb +0 -11
  114. data/spec/factories/fundraiser.rb +0 -24
  115. data/spec/factories/fundraising_page.rb +0 -29
  116. data/spec/factories/grant.rb +0 -22
  117. data/spec/factories/grant_institution.rb +0 -17
  118. data/spec/factories/institution.rb +0 -18
  119. data/spec/factories/kid/custom_institution.rb +0 -12
  120. data/spec/factories/kid.rb +0 -58
  121. data/spec/factories/kid_honor.rb +0 -16
  122. data/spec/factories/kid_institution.rb +0 -23
  123. data/spec/factories/lib/faker_patch.rb +0 -27
  124. data/spec/factories/lib/helpers.rb +0 -7
  125. data/spec/factories/location.rb +0 -17
  126. data/spec/factories/memorial/photos.rb +0 -14
  127. data/spec/factories/memorial/totals.rb +0 -11
  128. data/spec/factories/memorial/tribute.rb +0 -19
  129. data/spec/factories/memorial.rb +0 -22
  130. data/spec/factories/message.rb +0 -31
  131. data/spec/factories/milestone.rb +0 -15
  132. data/spec/factories/name_pieces.rb +0 -24
  133. data/spec/factories/newsletter_recipient.rb +0 -13
  134. data/spec/factories/organization/addresses.rb +0 -16
  135. data/spec/factories/organization/email_addresses.rb +0 -14
  136. data/spec/factories/organization/phone_numbers.rb +0 -14
  137. data/spec/factories/organization.rb +0 -34
  138. data/spec/factories/page.rb +0 -5
  139. data/spec/factories/participant/photos.rb +0 -14
  140. data/spec/factories/participant/policies.rb +0 -12
  141. data/spec/factories/participant/rankings/ranking.rb +0 -12
  142. data/spec/factories/participant/rankings.rb +0 -16
  143. data/spec/factories/participant/roles/role.rb +0 -154
  144. data/spec/factories/participant/roles.rb +0 -37
  145. data/spec/factories/participant/totals.rb +0 -11
  146. data/spec/factories/participant.rb +0 -95
  147. data/spec/factories/payment.rb +0 -13
  148. data/spec/factories/permissions.rb +0 -12
  149. data/spec/factories/person/addresses.rb +0 -16
  150. data/spec/factories/person/email_addresses.rb +0 -14
  151. data/spec/factories/person/phone_numbers.rb +0 -14
  152. data/spec/factories/person/policies.rb +0 -13
  153. data/spec/factories/person.rb +0 -22
  154. data/spec/factories/phone.rb +0 -11
  155. data/spec/factories/photo.rb +0 -11
  156. data/spec/factories/photos.rb +0 -9
  157. data/spec/factories/recurring_gift.rb +0 -22
  158. data/spec/factories/researcher.rb +0 -15
  159. data/spec/factories/response.rb +0 -38
  160. data/spec/factories/search_event.rb +0 -19
  161. data/spec/factories/search_fundraiser.rb +0 -15
  162. data/spec/factories/search_kid.rb +0 -13
  163. data/spec/factories/search_participant.rb +0 -15
  164. data/spec/factories/search_team.rb +0 -13
  165. data/spec/factories/shave_schedule/time_selection_permissions.rb +0 -12
  166. data/spec/factories/shave_schedule.rb +0 -33
  167. data/spec/factories/team/photos.rb +0 -12
  168. data/spec/factories/team/rankings/ranking.rb +0 -12
  169. data/spec/factories/team/rankings.rb +0 -15
  170. data/spec/factories/team/totals.rb +0 -14
  171. data/spec/factories/team.rb +0 -43
  172. data/spec/factories/third_party_media.rb +0 -12
  173. data/spec/factories/treatment_status.rb +0 -10
  174. data/spec/factories/user.rb +0 -14
  175. data/spec/factories/venue.rb +0 -15
@@ -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
@@ -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
@@ -1,58 +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.custom_institutions = [] if unpopulated?(evaluator, :custom_institutions)
28
- end
29
- end
30
-
31
- factory :kid_relationship, class: SBF::Client::Kid::Relationship do
32
- skip_create
33
-
34
- initialize_with do
35
- new(attributes)
36
- end
37
-
38
- type { SBF::Client::Kid::Relationship::Type::MOTHER }
39
- guardian_type { SBF::Client::Kid::Relationship::GuardianType::OTHER }
40
- end
41
-
42
- factory :kid_submitter, parent: :kid_relationship do
43
- is_submitter { true }
44
-
45
- after :build do |relationship, evaluator|
46
- relationship.permissions = {is_editor: true} if unpopulated?(evaluator, :permissions)
47
- end
48
- end
49
-
50
- factory :kid_url, class: SBF::Client::KidURL do
51
- skip_create
52
- initialize_with do
53
- new(attributes)
54
- end
55
-
56
- url { Faker::Internet.url }
57
- end
58
- end
@@ -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
@@ -1,7 +0,0 @@
1
- def unpopulated?(entity, field)
2
- field = field.to_sym
3
- if entity.instance_variable_get(:@instance).class.optional_attributes.include?(field)
4
- return true if entity.not_provided_attributes.include?(field)
5
- end
6
- entity.send(field).nil?
7
- end
@@ -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
@@ -1,11 +0,0 @@
1
- FactoryBot.define do
2
- factory :memorial_totals, class: SBF::Client::Memorial::Totals do
3
- skip_create
4
-
5
- initialize_with do
6
- new(attributes)
7
- end
8
-
9
- amount_raised { 100 }
10
- end
11
- end
@@ -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
@@ -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
@@ -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
@@ -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
@@ -1,5 +0,0 @@
1
- FactoryBot.define do
2
- factory :page, class: SBF::Client::Page do
3
- skip_create
4
- end
5
- end
@@ -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,12 +0,0 @@
1
- FactoryBot.define do
2
- factory :participant_policies, class: SBF::Client::Participant::Policies do
3
- skip_create
4
-
5
- initialize_with do
6
- new(attributes)
7
- end
8
-
9
- is_waiver_policy_accepted { true }
10
- is_razor_policy_accepted { true }
11
- end
12
- end
@@ -1,12 +0,0 @@
1
- FactoryBot.define do
2
- factory :participant_rankings_ranking, class: SBF::Client::Participant::Rankings::Ranking do
3
- skip_create
4
-
5
- initialize_with do
6
- new(attributes)
7
- end
8
-
9
- rank { 5 }
10
- total { 10 }
11
- end
12
- 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