转换RSpec 2“;在“上有()个错误”;匹配器至RSpec 3

转换RSpec 2“;在“上有()个错误”;匹配器至RSpec 3,rspec,rspec-rails,rspec3,Rspec,Rspec Rails,Rspec3,在我的档案里 gem 'rspec-rails', '~> 3.3' 我发现matcher上的错误转移到了另一块宝石上: 我确信在RSpec 3中必须有一种方法来实现同样的目标 如何将matcher上的RSpec 2 have().errors_转换为RSpec 3 expect { click_button(I18n.t('helpers.submit.accounting.update')) }.to have(4).errors_on(:share_ksk, :ce

在我的档案里

gem 'rspec-rails', '~> 3.3'
我发现matcher上的错误转移到了另一块宝石上:

我确信在RSpec 3中必须有一种方法来实现同样的目标

如何将matcher上的RSpec 2 have().errors_转换为RSpec 3

  expect {
    click_button(I18n.t('helpers.submit.accounting.update'))
  }.to have(4).errors_on(:share_ksk, :central_office, :limit_value, :fix_disagio)
我试过:

  expect {
    click_button(I18n.t('helpers.submit.accounting.update'))
  }.to have_validation_error(I18n.t('accounting.two_digits_after_decimal_point')).on(
:share_ksk, 
:central_office, 
:limit_value, 
:fix_disagio)
关于

但我得到一个RSpec错误:

 undefined method `on' for #<RSpec::Matchers::BuiltIn::Has:0x00000005913368>
的未定义方法“on”#

我不知道你可以在一个街区内呼叫RSpec 2匹配器。