From d8cba951fa8a30c7a9c21e104e271e3df3940384 Mon Sep 17 00:00:00 2001 From: Angel Perez Date: Tue, 29 Jan 2019 09:59:33 -0400 Subject: [PATCH] Replace order_coupon_code -> coupon_code solidusio/solidus#2958 replaced `order_coupon_code` text field for `coupon_code`, which broke master build. This patch fixes this regression. --- spec/features/checkout_spec.rb | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/spec/features/checkout_spec.rb b/spec/features/checkout_spec.rb index 947aee7..b77c7dd 100644 --- a/spec/features/checkout_spec.rb +++ b/spec/features/checkout_spec.rb @@ -286,8 +286,14 @@ it 'TaxCloud Test Case 3, with item discount' do add_to_cart('Shirt') - fill_in 'order_coupon_code', with: 'AAAA' - click_button 'Update' + if Spree.solidus_gem_version >= Gem::Version.new('2.8.0') + fill_in 'coupon_code', with: 'AAAA' + click_button 'Apply Code' + else + fill_in 'order_coupon_code', with: 'AAAA' + click_button 'Update' + end + expect(page).not_to have_content('The coupon code you entered doesn\'t exist.') expect(page).to have_content('The coupon code was successfully applied to your order.') click_button 'Checkout' @@ -311,7 +317,14 @@ add_to_cart('Shirt') add_to_cart('Shirt') - fill_in 'order_coupon_code', with: 'AAAA' + if Spree.solidus_gem_version >= Gem::Version.new('2.8.0') + fill_in 'coupon_code', with: 'AAAA' + click_button 'Apply Code' + else + fill_in 'order_coupon_code', with: 'AAAA' + click_button 'Update' + end + click_button 'Update' expect(page).not_to have_content('The coupon code you entered doesn\'t exist.') expect(page).to have_content('The coupon code was successfully applied to your order.')