We have many tests that check for flash messages. Currently, we search the whole page for the content or find it by a specific ID. To make it easier to test the exact content of flash messages, I added a spec helper. Example failure message: Failure/Error: expect(page).to have_flash_notice("An email has been sent to you with a link to verify your account2") expected: notice - An email has been sent to you with a link to verify your account2 actual error: (no error message) actual notice: An email has been sent to you with a link to verify your account
1.7 KiB
1.7 KiB