Wait for page before checking DB

This commit is contained in:
David Rodríguez
2025-11-04 19:11:43 +01:00
parent 278a8b1ec2
commit 4b31352e4f

View File

@@ -214,6 +214,7 @@ RSpec.describe 'Customers' do
expect(page).to have_content 'You have unsaved changes'
click_button "Save Changes"
expect(page).to have_content 'All changes saved successfully'
# changes are saved in the database
expect(customer4.reload.code).to eq(nil)
@@ -250,6 +251,7 @@ RSpec.describe 'Customers' do
expect(page).to have_content 'You have unsaved changes'
click_button "Save Changes"
expect(page).to have_content 'All changes saved successfully'
expect(customer4.reload.tag_list).to be_empty
end