7

I'm running into this error when upgrading from Rails 6.0.3 to 6.1:

  NoMethodError:
    undefined method `assert_nothing_raised' for #<RSpec::ExampleGroups::EmailJob:0x00005572d8a00758>
    Did you mean?  assert_raises

This happens every time a test calls perform_enqueued_jobs. I'm using RSpec 3.9.

alf
  • 18,372
  • 10
  • 61
  • 92

1 Answers1

9

Apparently assert_nothing_raised is a helper method defined by ActiveSupport. I was able to solve this issue by explicitly including the helper in spec/rails_helper.rb:

RSpec.configure do |config|
  config.include(ActiveSupport::Testing::Assertions)
  # ...
alf
  • 18,372
  • 10
  • 61
  • 92