user upgrades: fix checkout form leaking recipient's email.

The checkout form should be prefilled with the purchaser's email
address, not the recipient's.
This commit is contained in:
evazion
2020-12-25 02:01:42 -06:00
parent e030a07816
commit d9db32640a
2 changed files with 15 additions and 1 deletions

View File

@@ -45,5 +45,19 @@ class UserUpgradeTest < ActiveSupport::TestCase
end
end
end
context "the #create_checkout! method" do
context "for a gifted upgrade" do
context "to Gold" do
should "prefill the Stripe checkout page with the purchaser's email address" do
@user = create(:user, email_address: build(:email_address))
@user_upgrade = create(:gift_gold_upgrade, purchaser: @user)
@checkout = @user_upgrade.create_checkout!
assert_equal(@user.email_address.address, @checkout.customer_email)
end
end
end
end
end
end