-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to search for an email by subject #22
Comments
That's interesting. You could do this with the current API but you have to jump through a hoop or two: all_emails.find { |e| e.subject ~= /keyword/ }
all_emails.collect { |e| e.subject ~= /keyword/ } The first will return a single email, the second will return a collection of emails matching |
Should make things a little cleaner in our specs by pushing this logic into the gem. I also noticed the dissonance between |
I believe it is grabbing the last because the email is pushed onto a queue. I could be wrong, I'll have to double check. |
If that's the case, then I was just being too picky about code formatting :-P |
@bcardarella is this still an open issue? |
@bcardarella can be closed? |
checking at the source code (https://github.com/dockyard/capybara-email/blob/master/lib/capybara/email/dsl.rb#L42), I found current_emails.first.click_link 'Confirm my account' AND current_emails.last.click_link 'Change my password'
# current_email is already a last email so we can directly write:
current_email.click_link "Change my password" So, I guess, you can reference your emails by array index like: current_emails[0]
current_emails[1]
and so on .... Hope this is helpful. And yes, I agree, if gem will implement some way to directly fetch emails with their subject. Thanks |
Have multiple emails reaching one user.
Need to find based on subject.
Investigating.
The text was updated successfully, but these errors were encountered: