Spec for duplicate customers after changing email

This commit is contained in:
Maikel Linke
2022-09-14 14:42:23 +10:00
committed by Konrad
parent 0d1f48ac0d
commit 93da64f466

View File

@@ -973,6 +973,21 @@ describe Spree::Order do
expect(order.customer).to be_present
end
it "recognises users with changed email address" do
pending "#9002"
order.update!(state: "complete")
# Change email instantly without confirmation via Devise:
order.user.update_columns(email: "new@email.org")
other_order = create(:order, user: order.user, distributor: distributor)
expect {
other_order.update!(state: "complete")
}.to_not change { Customer.count }
end
end
end