Skip to content

Commit

Permalink
Remove pick_up_person trait
Browse files Browse the repository at this point in the history
  • Loading branch information
norrismei committed Oct 4, 2024
1 parent a537810 commit 8439cc2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 17 deletions.
11 changes: 1 addition & 10 deletions spec/factories/partners.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,11 @@
status { :awaiting_review }
end

transient do
pick_up_person { false }
end

after(:create) do |partner, evaluator|
next if evaluator.try(:without_profile)

# Create associated records
if evaluator.pick_up_person
create(:partner_profile, :with_pickup_person, partner_id: partner.id)
else
create(:partner_profile, partner_id: partner.id)
end

create(:partner_profile, partner_id: partner.id)
create(:partner_user, email: partner.email, name: partner.name, partner: partner)
end
end
Expand Down
6 changes: 0 additions & 6 deletions spec/factories/partners/profiles.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,5 @@
website { "http://some-site.org" }
primary_contact_email { Faker::Internet.email }
primary_contact_name { Faker::Name.name }

trait :with_pickup_person do
pick_up_name { "Paul Bunyan" }
pick_up_email { "paul@kenton.com" }
pick_up_phone { "503-123-4567" }
end
end
end
5 changes: 4 additions & 1 deletion spec/pdfs/picklists_pdf_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@

context "When partner pickup person is set" do
it "renders pickup person details" do
partner = create(:partner, pick_up_person: true)
partner = create(:partner)
partner.profile.pick_up_name = "Paul Bunyan"
partner.profile.pick_up_email = "paul@kenton.com"
partner.profile.pick_up_phone = "503-123-4567"
request = create(:request, :pending, organization: organization, partner: partner)
pdf = described_class.new(organization, [request])
pdf_test = PDF::Reader.new(StringIO.new(pdf.compute_and_render))
Expand Down

0 comments on commit 8439cc2

Please sign in to comment.