Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions api/spec/requests/spree/api/checkouts_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
}
end

it "can update addresses and transition from address to delivery" do

Check warning on line 87 in api/spec/requests/spree/api/checkouts_spec.rb

View workflow job for this annotation

GitHub Actions / solidus_api / Rails 8.0, Ruby 3.4, sqlite, activestorage

Checkouts PUT 'update' transitioning to delivery can update addresses and transition from address to delivery Skipped: SQLite adapter fails sometimes to provide a unique index for the convoluted chain of ActiveRecord persistence calls that happen on https://github.com/solidusio/solidus/blob/8b03161a1894a7d10c8d95f62c016da55027d2b0/core/app/models/spree/stock/simple_coordinator.rb#L83
skip <<~MSG if ActiveRecord::Base.connection.adapter_name == "SQLite"
SQLite adapter fails sometimes to provide a unique index for the convoluted chain
of ActiveRecord persistence calls that happen on
Expand All @@ -109,6 +109,20 @@
expect(response.status).to eq(200)
end

# Regression test for https://github.com/solidusio/solidus/issues/2845
it "does not persist the address to the user's address book when temporary_address is set" do
expect_any_instance_of(Spree.user_class).not_to receive(:persist_order_address)

put spree.api_checkout_path(order),
params: {order_token: order.guest_token, order: {
temporary_address: true,
bill_address_attributes: address,
ship_address_attributes: address
}}

expect(response.status).to eq(200)
end

# Regression Spec for https://github.com/spree/spree/issues/5389 and https://github.com/spree/spree/issues/5880
it "can update addresses but not transition to delivery w/o shipping setup" do
Spree::ShippingMethod.all.find_each(&:destroy)
Expand All @@ -122,7 +136,7 @@
end

# Regression test for https://github.com/spree/spree/issues/4498
it "does not contain duplicate variant data in delivery return" do

Check warning on line 139 in api/spec/requests/spree/api/checkouts_spec.rb

View workflow job for this annotation

GitHub Actions / solidus_api / Rails 8.0, Ruby 3.4, sqlite, activestorage

Checkouts PUT 'update' transitioning to delivery does not contain duplicate variant data in delivery return Skipped: SQLite adapter fails sometimes to provide a unique index for the convoluted chain of ActiveRecord persistence calls that happen on https://github.com/solidusio/solidus/blob/8b03161a1894a7d10c8d95f62c016da55027d2b0/core/app/models/spree/stock/simple_coordinator.rb#L83
skip <<~MSG if ActiveRecord::Base.connection.adapter_name == "SQLite"
SQLite adapter fails sometimes to provide a unique index for the convoluted chain
of ActiveRecord persistence calls that happen on
Expand Down
1 change: 1 addition & 0 deletions core/lib/spree/permitted_attributes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ module PermittedAttributes
@@checkout_address_attributes = [
:use_billing,
:use_shipping,
:temporary_address,
:email,
bill_address_attributes: address_attributes,
ship_address_attributes: address_attributes
Expand Down
Loading