You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. VERY IMPORTANT SENTENCE. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
With the refactored email step an email should have been sent with: I can't test for "VERY IMPORTANT SENTENCE" anymore.
Maybe it's possible to adapt the expected_body_regex in the MailFinder to also allow a wildcard at the beginning, like this:
Then an email should have been sent with:
"""
From: [email protected]
To: [email protected]
Subject: Lorem ipsum
Lorem ipsum dolor sit amet, consetetur sadipscing elitr*
*VERY IMPORTANT SENTENCE*
Ut wisi enim ad minim veniam*
"""
My suggestion is to add expected.gsub! '\n\*', '\n.*' to the method
def expected_body_regex(expected_body)
# To stay backwards-compatible, this will only check whether an email
# starts with the expected body.
expected = '\A\n' + Regexp.quote(expected_body.strip) + '\n\Z'
expected.gsub! '\n\*\n', '\n[\s\S]*\n'
expected.gsub! '\*\n', '.*\n'
expected.gsub! '\A\n', '\A'
expected.gsub! '\n\Z', '' # Change '' to '\Z' to force that the whole body matches
Regexp.new(expected)
end
Do you see any problems with that?
The text was updated successfully, but these errors were encountered:
Given we have this email:
With the refactored email step
an email should have been sent with:
I can't test for "VERY IMPORTANT SENTENCE" anymore.Maybe it's possible to adapt the
expected_body_regex
in the MailFinder to also allow a wildcard at the beginning, like this:My suggestion is to add
expected.gsub! '\n\*', '\n.*'
to the methodDo you see any problems with that?
The text was updated successfully, but these errors were encountered: