升级到Rails 5 rc1后,规范失败

时间:2016-05-12 18:52:00

标签: ruby-on-rails ruby capybara ruby-on-rails-5

我有一个非常简单的规范,看起来像这样:

scenario 'show error message' do
  expect(page).to have_text 'Invalid email or password.'
end

升级到Rails 5 rc1后失败:

  1) Sign in when email and password are invalid show error message
     Failure/Error: expect(page).to have_text 'Invalid email or password.'
       expected to find text "Invalid email or password." in "× Invalid Email or password. Sign in Please fill the form to sign in to your account * Email * Password Remember me (if this is a private computer) Forgot password? Copyright @ 2016"

测试正在传递Rails 5 beta3。

有什么想法吗?

1 个答案:

答案 0 :(得分:1)

电子邮件现已大写。在规范中更改它(或者,更好的是,使用更宽容的测试,这样就不会再发生了。)