Add required fields to order cycle spec

This commit is contained in:
Dan Ingenthron
2019-10-09 00:20:52 -05:00
parent 85dede84cc
commit 241e581779

View File

@@ -181,11 +181,17 @@ feature '
select2_select 'My coordinator', from: 'coordinator_id'
click_button "Continue >"
# And I fill in the basic fields
# I cannot save before filling in the required fields
expect(page).to have_button("Create", disabled: true)
# After I fill in the basic fields
fill_in 'order_cycle_name', with: 'Plums & Avos'
fill_in 'order_cycle_orders_open_at', with: order_cycle_opening_time
fill_in 'order_cycle_orders_close_at', with: order_cycle_closing_time
# I can save the form
expect(page).to have_button("Create", disabled: false)
# And I add a coordinator fee
click_button 'Add coordinator fee'
select 'Coord fee', from: 'order_cycle_coordinator_fee_0_id'
@@ -998,13 +1004,19 @@ feature '
visit admin_order_cycles_path
click_link 'New Order Cycle'
# And I fill in the basic fields
# I cannot save without the required fields
expect(page).to have_button('Create', disabled: true)
# After I fill in the basic fields
fill_in 'order_cycle_name', with: 'Plums & Avos'
fill_in 'order_cycle_orders_open_at', with: '2040-10-17 06:00:00'
fill_in 'order_cycle_orders_close_at', with: '2040-10-24 17:00:00'
fill_in 'order_cycle_outgoing_exchange_0_pickup_time', with: 'pickup time'
fill_in 'order_cycle_outgoing_exchange_0_pickup_instructions', with: 'pickup instructions'
# I can save the form
expect(page).to have_button('Create', disabled: false)
# Then my products / variants should already be selected
expect(page).to have_checked_field "order_cycle_incoming_exchange_0_variants_#{v1.id}"
expect(page).to have_checked_field "order_cycle_incoming_exchange_0_variants_#{v2.id}"