diff options
author | fastjames <fastjames@gmail.com> | 2018-08-02 11:11:16 -0500 |
---|---|---|
committer | Angel Perez <iAngel.p93@gmail.com> | 2018-12-12 18:49:18 +0100 |
commit | 0da51ca0a14199ba5b7ca42177ed9e6799a0bf4f (patch) | |
tree | 1b71dd8332f02e5d4d6eef216ab6d73617df7a7e /spec/controllers | |
parent | b8b8df59b3be50590ad60ea1bfdb81a61c2f4929 (diff) |
Realign specs and solidus versions
Update specs for newer versions of Solidus. This only required one
version-specific code branch. I know 2.2 is still not EOL but we can
reintroduce it to the matrix separately if people want that.
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/solidus_subscriptions/api/v1/line_items_controller_spec.rb | 15 | ||||
-rw-r--r-- | spec/controllers/solidus_subscriptions/api/v1/subscriptions_controller_spec.rb | 7 |
2 files changed, 17 insertions, 5 deletions
diff --git a/spec/controllers/solidus_subscriptions/api/v1/line_items_controller_spec.rb b/spec/controllers/solidus_subscriptions/api/v1/line_items_controller_spec.rb index d2025dd..f6fafb0 100644 --- a/spec/controllers/solidus_subscriptions/api/v1/line_items_controller_spec.rb +++ b/spec/controllers/solidus_subscriptions/api/v1/line_items_controller_spec.rb @@ -13,7 +13,8 @@ RSpec.describe SolidusSubscriptions::Api::V1::LineItemsController, type: :contro { id: line.id, subscription_line_item: { quantity: 21 }, - token: user.spree_api_key + token: user.spree_api_key, + format: :json } end subject { post :update, params: params } @@ -71,7 +72,8 @@ RSpec.describe SolidusSubscriptions::Api::V1::LineItemsController, type: :contro { id: line.id, subscription_line_item: { interval_length: -1 }, - token: user.spree_api_key + token: user.spree_api_key, + format: :json } end @@ -86,7 +88,14 @@ RSpec.describe SolidusSubscriptions::Api::V1::LineItemsController, type: :contro end describe "#destroy" do - let(:params) { { id: line.id, order_id: order.id, token: user.spree_api_key } } + let(:params) { + { + id: line.id, + order_id: order.id, + token: user.spree_api_key, + format: :json + } + } subject { delete :destroy, params: params } context "when the order is not ours" do diff --git a/spec/controllers/solidus_subscriptions/api/v1/subscriptions_controller_spec.rb b/spec/controllers/solidus_subscriptions/api/v1/subscriptions_controller_spec.rb index a4f9e6d..59daf1c 100644 --- a/spec/controllers/solidus_subscriptions/api/v1/subscriptions_controller_spec.rb +++ b/spec/controllers/solidus_subscriptions/api/v1/subscriptions_controller_spec.rb @@ -41,6 +41,9 @@ RSpec.describe SolidusSubscriptions::Api::V1::SubscriptionsController, type: :co } end + let(:address_country) { create(:country) } + let(:address_state) { create(:state, country: address_country) } + let(:subscription_params) do { line_items_attributes: [{ @@ -52,8 +55,8 @@ RSpec.describe SolidusSubscriptions::Api::V1::SubscriptionsController, type: :co lastname: 'Ketchum', address1: '1 Rainbow Road', city: 'Palette Town', - country_id: create(:country).id, - state_id: create(:state).id, + country_id: address_country.id, + state_id: address_state.id, phone: '999-999-999', zipcode: '10001' } |