From 1c8809323ba2a36461b2d0751baa26ae051d0856 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Busqu=C3=A9?= Date: Fri, 11 Aug 2023 10:41:06 +0200 Subject: [PATCH] Fix specs due to upstream changes on states_required field Country factory was changed to assign a realistic states_required field. We update our test suite to account for this change. See https://github.com/solidusio/solidus/pull/4272 [skip ci] --- .../checkout/add_addresses_to_checkout_spec.rb | 2 +- spec/support/graphql/responses/countries.json.erb | 4 ++-- spec/support/graphql/responses/current_user.json.erb | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/spec/integration/mutations/checkout/add_addresses_to_checkout_spec.rb b/spec/integration/mutations/checkout/add_addresses_to_checkout_spec.rb index cf481e7e..7490eac8 100644 --- a/spec/integration/mutations/checkout/add_addresses_to_checkout_spec.rb +++ b/spec/integration/mutations/checkout/add_addresses_to_checkout_spec.rb @@ -13,7 +13,7 @@ ] } - let(:country_id) { SolidusGraphqlApi::Schema.id_from_object(create(:country), nil, nil) } + let(:country_id) { SolidusGraphqlApi::Schema.id_from_object(create(:country, states_required: false), nil, nil) } let(:address) { address = build_stubbed(:address).slice(:address1, :city, :phone, :zipcode) address[:countryId] = country_id diff --git a/spec/support/graphql/responses/countries.json.erb b/spec/support/graphql/responses/countries.json.erb index 1b40d02e..bde086f6 100644 --- a/spec/support/graphql/responses/countries.json.erb +++ b/spec/support/graphql/responses/countries.json.erb @@ -28,7 +28,7 @@ } ] }, - "statesRequired": false, + "statesRequired": true, "updatedAt": "2012-12-21T12:00:00Z" }, { @@ -42,7 +42,7 @@ "states": { "nodes": [] }, - "statesRequired": false, + "statesRequired": true, "updatedAt": "2012-12-21T12:00:00Z" } ] diff --git a/spec/support/graphql/responses/current_user.json.erb b/spec/support/graphql/responses/current_user.json.erb index c3080209..e9875801 100644 --- a/spec/support/graphql/responses/current_user.json.erb +++ b/spec/support/graphql/responses/current_user.json.erb @@ -15,7 +15,7 @@ "iso3": "USA", "name": "United States", "numcode": 840, - "statesRequired": false, + "statesRequired": true, "createdAt": "2012-12-21T12:00:00Z", "updatedAt": "2012-12-21T12:00:00Z" }, @@ -45,7 +45,7 @@ "iso3": "USA", "name": "United States", "numcode": 840, - "statesRequired": false, + "statesRequired": true, "createdAt": "2012-12-21T12:00:00Z", "updatedAt": "2012-12-21T12:00:00Z" }, @@ -77,7 +77,7 @@ "iso3": "USA", "name": "United States", "numcode": 840, - "statesRequired": false, + "statesRequired": true, "createdAt": "2012-12-21T12:00:00Z", "updatedAt": "2012-12-21T12:00:00Z" }, @@ -109,7 +109,7 @@ "iso3": "USA", "name": "United States", "numcode": 840, - "statesRequired": false, + "statesRequired": true, "createdAt": "2012-12-21T12:00:00Z", "updatedAt": "2012-12-21T12:00:00Z" }, @@ -143,7 +143,7 @@ "iso3": "USA", "name": "United States", "numcode": 840, - "statesRequired": false, + "statesRequired": true, "createdAt": "2012-12-21T12:00:00Z", "updatedAt": "2012-12-21T12:00:00Z" }, @@ -183,7 +183,7 @@ "iso3": "USA", "name": "United States", "numcode": 840, - "statesRequired": false, + "statesRequired": true, "createdAt": "2012-12-21T12:00:00Z", "updatedAt": "2012-12-21T12:00:00Z" },