From 40c329ba68d8859406e47cbbec84b810dca26f9c Mon Sep 17 00:00:00 2001 From: Dan Ingenthron Date: Tue, 22 Oct 2019 17:35:32 -0500 Subject: [PATCH] Distinguish between simple create form and full interface in OC feature spec --- spec/features/admin/order_cycles_spec.rb | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/spec/features/admin/order_cycles_spec.rb b/spec/features/admin/order_cycles_spec.rb index f2dba44c5a..ab981ba6ff 100644 --- a/spec/features/admin/order_cycles_spec.rb +++ b/spec/features/admin/order_cycles_spec.rb @@ -153,7 +153,7 @@ feature ' let(:order_cycle_opening_time) { Time.zone.local(2040, 11, 0o6, 0o6, 0o0, 0o0).strftime("%F %T %z") } let(:order_cycle_closing_time) { Time.zone.local(2040, 11, 13, 17, 0o0, 0o0).strftime("%F %T %z") } - scenario "creating an order cycle", js: true do + scenario "creating an order cycle with full interface", js: true do # Given coordinating, supplying and distributing enterprises with some products with variants coordinator = create(:distributor_enterprise, name: 'My coordinator') supplier = create(:supplier_enterprise, name: 'My supplier') @@ -184,14 +184,14 @@ feature ' # I cannot save before filling in the required fields expect(page).to have_button("Create", disabled: true) - # After I fill in the basic fields + # The Create button is enabled once Name is entered fill_in 'order_cycle_name', with: 'Plums & Avos' + expect(page).to have_button("Create", disabled: false) + + # If I fill in the basic fields 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' @@ -1007,16 +1007,16 @@ feature ' # I cannot save without the required fields expect(page).to have_button('Create', disabled: true) - # After I fill in the basic fields + # The Create button is enabled once the mandatory fields are entered fill_in 'order_cycle_name', with: 'Plums & Avos' + fill_in 'order_cycle_outgoing_exchange_0_pickup_time', with: 'pickup time' + expect(page).to have_button('Create', disabled: false) + + # If I fill in the basic fields 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}"