Skip to content

Commit

Permalink
Add missing description to some examples
Browse files Browse the repository at this point in the history
  • Loading branch information
oldjackson committed Mar 29, 2020
1 parent 3e733a3 commit 68a82ab
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions core/spec/models/spree/concerns/user_address_book_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -239,22 +239,20 @@ module Spree
expect(subject).to eq address
end

context "sets it as default" do
context "shipping address" do
it do
subject
expect(user.ship_address).to eq address
expect(user.default_address).to eq address
end
context "when called with default address_type" do
it "sets the passed address as default shipping address" do
subject
expect(user.ship_address).to eq address
expect(user.default_address).to eq address
end
end

context "billing address" do
subject { user.save_in_address_book(address.attributes, true, :billing) }
context "when called with address_type = :billing" do
subject { user.save_in_address_book(address.attributes, true, :billing) }

it do
subject
expect(user.bill_address).to eq address
end
it "sets the passed address as default billing address" do
subject
expect(user.bill_address).to eq address
end
end

Expand Down Expand Up @@ -567,7 +565,7 @@ module Spree
allow(Spree::Address).to receive(:immutable_merge).and_return address
end

it do
it "updates ship_address with its present attributes merged with the passed ones" do
expect(Spree::Address).to receive(:immutable_merge).with(user.ship_address, attributes)
expect(user).to receive(:ship_address=).with address

Expand Down

0 comments on commit 68a82ab

Please sign in to comment.