From 424fe7f5d2325016be1cb0c7ad6c8772fd86a1f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Thu, 1 Apr 2021 17:23:14 +0200 Subject: [PATCH] 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. --- spec/system/emails_spec.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/system/emails_spec.rb b/spec/system/emails_spec.rb index 5aa3be7ac..8e6743fb0 100644 --- a/spec/system/emails_spec.rb +++ b/spec/system/emails_spec.rb @@ -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)