Add extra expectation in emails spec

The test is failing on my machine sometimes. I thought it was because
`open_last_email` didn't wait fot the request generated by clicking the
"Registrarse" button to finish. Even if that might be the case, adding
an extra expectation showed the test was really failing because
invisible captcha reported the form was filled in too fast.

I wonder whether invisible captcha is working properly or there are
times where it doesn't start its timer when it should.

Since this might be a bug in the application, I'm not changing the test
just to make it pass.
This commit is contained in:
Javi Martín
2021-04-01 17:23:14 +02:00
parent 911640d2b2
commit 424fe7f5d2

View File

@@ -209,6 +209,8 @@ describe "Emails" do
fill_in_signup_form
click_button "Registrarse"
expect(page).to have_content "visita el enlace para activar tu cuenta."
email = open_last_email
expect(email).to deliver_to("manuela@consul.dev")
expect(email).to have_body_text(user_confirmation_path)