From 91e4fb18ed662d67714d2539e09eefb861474f38 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Mon, 14 Aug 2023 12:46:13 +1000 Subject: [PATCH] Use input labels in Voucher system spec It's more robust, and closer to what the user sees and does. It's also verifying that the labels are correctly connected to the inputs. --- spec/system/admin/vouchers_spec.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/system/admin/vouchers_spec.rb b/spec/system/admin/vouchers_spec.rb index 68b7fe83f3..6c113ec693 100644 --- a/spec/system/admin/vouchers_spec.rb +++ b/spec/system/admin/vouchers_spec.rb @@ -50,9 +50,9 @@ describe ' context "with a flat rate voucher" do it 'creates a voucher' do # And I fill in the fields for a new voucher click save - fill_in 'vouchers_flat_rate_code', with: voucher_code - select "Flat", from: "vouchers_flat_rate_voucher_type" - fill_in 'vouchers_flat_rate_amount', with: amount + fill_in "Voucher Code", with: voucher_code + select "Flat", from: "Voucher Type" + fill_in "Amount", with: amount click_button 'Save' # Then I should get redirect to the entreprise voucher tab and see the created voucher @@ -64,9 +64,9 @@ describe ' context "with a percentage rate voucher" do it 'creates a voucher' do # And I fill in the fields for a new voucher click save - fill_in 'vouchers_flat_rate_code', with: voucher_code - select "Percentage (%)", from: "vouchers_flat_rate_voucher_type" - fill_in 'vouchers_flat_rate_amount', with: amount + fill_in "Voucher Code", with: voucher_code + select "Percentage (%)", from: "Voucher Type" + fill_in "Amount", with: amount click_button 'Save' # Then I should get redirect to the entreprise voucher tab and see the created voucher