diff --git a/spec/system/admin/order_cycles/edit_spec.rb b/spec/system/admin/order_cycles/edit_spec.rb index 77e406e271..a5a6e8b421 100644 --- a/spec/system/admin/order_cycles/edit_spec.rb +++ b/spec/system/admin/order_cycles/edit_spec.rb @@ -74,26 +74,27 @@ RSpec.describe ' end end - context 'with no attached order' do + context "with no attached order" do it "does not show warning modal" do login_as_admin visit edit_admin_order_cycle_path(order_cycle) # change non-date range field value - fill_in 'order_cycle_name', with: "OC1 name updated" - expect(page).to have_content('You have unsaved changes') + fill_in "order_cycle_name", with: "OC1 name updated" + expect(page).to have_content "You have unsaved changes" # click save - click_button('Save') - expect(page).to have_field 'order_cycle_name', with: 'OC1 name updated' - expect(page).to have_content('Your order cycle has been updated.') + click_button "Save" + expect(page).not_to have_content "You have unsaved changes" + expect(page).to have_content "Your order cycle has been updated." + expect(page).to have_field "order_cycle_name", with: "OC1 name updated" select_datetime_from "#order_cycle_orders_close_at", "2024-03-30 00:00" - expect(page).to have_content('You have unsaved changes') + expect(page).to have_content "You have unsaved changes" - click_button('Save') - expect(page).to have_field 'order_cycle_orders_close_at', with: '2024-03-30 00:00' - expect(page).to have_content('Your order cycle has been updated.') + click_button "Save" + expect(page).to have_field "order_cycle_orders_close_at", with: "2024-03-30 00:00" + expect(page).to have_content "Your order cycle has been updated." end end end