【问题标题】:Spec failing after upgrade to Rails 5 rc1升级到 Rails 5 rc1 后规范失败
【发布时间】:2016-05-12 18:52:00
【问题描述】:

我有一个非常简单的规范,如下所示:

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 上通过。

有什么想法吗?

【问题讨论】:

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


    【解决方案1】:

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

    【讨论】:

    • 天啊。谢谢。但为什么过去的规范通过了?
    • 我猜他们改了?这通常是发生在“新版本”之类的事情上。主要版本经常有像这样的重大变化。
    猜你喜欢
    • 1970-01-01
    • 2014-08-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-29
    • 1970-01-01
    • 1970-01-01
    • 2012-12-25
    相关资源
    最近更新 更多