如何使用 capybara-webkit 将消息发送到外部网络

how to use capybara-webkit to get a message send to external network

假设用户正在更新他的密码,点击提交,系统会发送一封确认邮件link到他的邮箱。我的问题是:当我使用rspec+capybara-webkit测试我的系统时,如何才能收到邮件并点击确认link,

希望您打开 ActionMailer 来测试邮件。

请使用capybara-emailgem

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