mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-27 21:06:49 +00:00
Add Customer.full_name
This commit is contained in:
committed by
Maikel Linke
parent
5ca4d549e7
commit
ba6523bb76
@@ -36,6 +36,10 @@ class Customer < ApplicationRecord
|
||||
|
||||
private
|
||||
|
||||
def full_name
|
||||
"#{first_name} #{last_name}".strip
|
||||
end
|
||||
|
||||
def downcase_email
|
||||
email&.downcase!
|
||||
end
|
||||
|
||||
@@ -1054,7 +1054,7 @@ describe Spree::Order do
|
||||
expect(order.customer).to be_nil
|
||||
expect { order.send(:ensure_customer) }.to change{ Customer.count }.by 1
|
||||
|
||||
expect(order.customer.name).to eq order.bill_address.full_name
|
||||
expect(order.customer.full_name).to eq order.bill_address.full_name
|
||||
expect(order.customer.bill_address.same_as?(order.bill_address)).to be true
|
||||
expect(order.customer.ship_address.same_as?(order.ship_address)).to be true
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user