mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Tidy one spec example
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user