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
The current implementation of the mentioned step is missing a safeguard if paths is empty, i.e. when no link has been found in the mail. It is quite hard to debug as visit nil will trigger an exception somewhere else.
# Please note that this step will only follow HTTP and HTTPS links.# Other links (such as mailto: or ftp:// links) are ignored.When/^I follow the (first|second|third)? ?link in the e?mail$/do |index_in_words|
mail=@mail || ActionMailer::Base.deliveries.lastindex={nil=>0,'first'=>0,'second'=>1,'third'=>2}[index_in_words]url_pattern=%r((?:https?://[^/]+)([^"'\s]+))paths=ifmail.html_partdom=Nokogiri::HTML(mail.html_part.body.to_s)(dom / 'a[href]').map{ |a| a['href'].match(url_pattern)}.compact.map{ |match| match[1]}elsemail_body=MailFinder.email_text_body(mail).to_smail_body.scan(url_pattern).flatten(1)endvisitpaths[index]end.overridable
I'd love to see a better error message in this case
The text was updated successfully, but these errors were encountered:
The current implementation of the mentioned step is missing a safeguard if
paths
is empty, i.e. when no link has been found in the mail. It is quite hard to debug asvisit nil
will trigger an exception somewhere else.I'd love to see a better error message in this case
The text was updated successfully, but these errors were encountered: