[英]how to use capybara-webkit to get a message send to external network
假设用户正在更新密码,然后单击提交,系统将发送一封包含确认链接的电子邮件至他的邮箱。 我的问题是:使用rspec + capybara-webkit测试系统时,如何获取电子邮件并单击确认链接,
希望您通过打开ActionMailer来测试它。
请使用capybara-email
gem
https://github.com/dockyard/capybara-email
你可以做下面的事情
Scenario: Email is sent to winning user
Given "me@example.com" is playing a game
When that user picks a winning piece
Then "me@example.com" receives an email with "You've Won!" as the subject
Then /^"([^"]*)" receives an email with "([^"]*)" as the subject$/ do |email_address, subject|
open_email(email_address)
expect(current_email.subject).to eq subject
end
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.