mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-05 07:19:14 +00:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user