From e68c22bb38070253f82b05becb87f386339d6ab2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Mon, 28 Nov 2022 12:57:35 +0100 Subject: [PATCH] Add expectations in tests confirming account One of these tests has failed once because there wasn't a user with the right confirmation token. While I haven't been able to reproduce the issue, there's a chance it's caused by a `visit` call to the confirmation path which might start before the redirect request to the successful sign up page has finished. I'm not sure this is the case, though, but, worst case scenario, if the test fails again we'll know it isn't because of a missing expectation. --- spec/system/multitenancy_spec.rb | 2 ++ spec/system/users_auth_spec.rb | 3 +++ 2 files changed, 5 insertions(+) diff --git a/spec/system/multitenancy_spec.rb b/spec/system/multitenancy_spec.rb index 45f6d473f..513a4489e 100644 --- a/spec/system/multitenancy_spec.rb +++ b/spec/system/multitenancy_spec.rb @@ -129,6 +129,8 @@ describe "Multitenancy", :seed_tenants do check "By registering you accept the terms and conditions of use" click_button "Register" + expect(page).to have_content "You have been sent a message containing a verification link" + confirm_email expect(page).to have_content "Your account has been confirmed." diff --git a/spec/system/users_auth_spec.rb b/spec/system/users_auth_spec.rb index 8a4b93497..1d51c5630 100644 --- a/spec/system/users_auth_spec.rb +++ b/spec/system/users_auth_spec.rb @@ -392,6 +392,9 @@ describe "Users" do fill_in "Username", with: "manuela2" click_button "Register" + + expect(page).to have_content "To continue, please click on the confirmation link that we have sent you via email" + confirm_email expect(page).to have_content "Your account has been confirmed"