-
-
Save Fercell/1706a7779e3f143a670a to your computer and use it in GitHub Desktop.
Time issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let(:date_from) { Time.now - 60 } | |
let(:query) { "email:'gal.andrius@yahoo.com' AND subject:'Reset password instructions' AND ts:[#{date_from.to_i} TO #{Time.now.to_i}]" } | |
let(:messages) { mandrill.messages.search query } | |
let(:message_id) { messages.first['_id'] } | |
let(:message) { mandrill.messages.content message_id } | |
let(:url) { message['text'].match(/http:\/\/.*(?=>)/).to_s } | |
let(:response) { Faraday.get(url) } | |
let(:reset_password_url) { response.headers['location'].gsub('http', 'https') } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it 'checks email that contains reset password link', :retry => 3, :retry_wait => 300 do | |
expect(message).to have_content('Reset my password') | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment