Add missing expectations before opening the last email
We weren't checking that the requests had finished before checking the
last sent email. That's probably why one of these tests has recently
failed on our CI:
```
1) System Emails Preview Pending #send_pending
Failure/Error: email = open_last_email
RuntimeError:
No email has been sent!
```
This commit is contained in:
@@ -11,6 +11,7 @@ module Users
|
|||||||
check "user_terms_of_service"
|
check "user_terms_of_service"
|
||||||
|
|
||||||
click_button "Register"
|
click_button "Register"
|
||||||
|
expect(page).to have_content "Thank you for registering"
|
||||||
end
|
end
|
||||||
|
|
||||||
def login_through_form_with_email_and_password(email = "manuela@consul.dev", password = "judgementday")
|
def login_through_form_with_email_and_password(email = "manuela@consul.dev", password = "judgementday")
|
||||||
|
|||||||
@@ -359,6 +359,8 @@ describe "System Emails" do
|
|||||||
|
|
||||||
click_button "Send pending"
|
click_button "Send pending"
|
||||||
|
|
||||||
|
expect(page).to have_content "Pending notifications sent successfully"
|
||||||
|
|
||||||
email = open_last_email
|
email = open_last_email
|
||||||
expect(email).to deliver_to(voter)
|
expect(email).to deliver_to(voter)
|
||||||
expect(email).to have_body_text(proposal_notification.body)
|
expect(email).to have_body_text(proposal_notification.body)
|
||||||
|
|||||||
Reference in New Issue
Block a user