Tidy one spec example

This commit is contained in:
Maikel Linke
2024-12-19 16:39:49 +11:00
parent 72376da98f
commit 874c464088

View File

@@ -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