diff options
author | Joel Jackson <jackson.joel@gmail.com> | 2017-06-14 21:44:24 -0700 |
---|---|---|
committer | Brendan Deere <brendan@stembolt.com> | 2017-07-24 10:36:08 -0700 |
commit | 948f7b502f20bc91e59e82741dedd005584a44a2 (patch) | |
tree | 40e2a94f26574149209a10417ff8396f6af399ac /spec | |
parent | cb9c60d8252c4b72c756c76501ae4f51646f389f (diff) |
Don't test versions lower than 1.3 for checkout step rearrangement.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/solidus_subscriptions/checkout_spec.rb | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/spec/models/solidus_subscriptions/checkout_spec.rb b/spec/models/solidus_subscriptions/checkout_spec.rb index caa68a3..66d541c 100644 --- a/spec/models/solidus_subscriptions/checkout_spec.rb +++ b/spec/models/solidus_subscriptions/checkout_spec.rb @@ -105,28 +105,30 @@ RSpec.describe SolidusSubscriptions::Checkout do end end - context 'Altered checkout flow' do - before do - @old_checkout_flow = Spree::Order.checkout_flow - Spree::Order.remove_checkout_step(:delivery) - end + if Gem::Specification.all.find{ |gem| gem.name == 'solidus' }.version >= Gem::Version.new('1.3.0') + context 'Altered checkout flow' do + before do + @old_checkout_flow = Spree::Order.checkout_flow + Spree::Order.remove_checkout_step(:delivery) + end - after do - Spree::Order.checkout_flow(&@old_checkout_flow) - end + after do + Spree::Order.checkout_flow(&@old_checkout_flow) + end - it 'has a payment' do - expect(order.payments.valid).to be_present - end + it 'has a payment' do + expect(order.payments.valid).to be_present + end - it 'has the correct totals' do - expect(order).to have_attributes( - total: 39.98, - shipment_total: 0 - ) - end + it 'has the correct totals' do + expect(order).to have_attributes( + total: 39.98, + shipment_total: 0 + ) + end - it { is_expected.to be_complete } + it { is_expected.to be_complete } + end end context 'the variant is out of stock' do |