Skip to content
This repository has been archived by the owner on Jun 4, 2023. It is now read-only.

mobilutz/rspec-rails7

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Error with Rails 7

When running bundle exec rspec spec with Rails 7.0 I get the following error:

❯ bunle exec rspec spec
F

Failures:

  1) TestClass does something
     Failure/Error: expect { test_class.perform }.to raise_error(::SomeError)

       expected SomeError, got #<NoMethodError: undefined method `message' for "Authentication Error":String> with backtrace:
         # ./app/services/test_class.rb:9:in `rescue in perform'
         # ./app/services/test_class.rb:6:in `perform'
         # ./spec/test_class_spec.rb:17:in `block (3 levels) in <top (required)>'
         # ./spec/test_class_spec.rb:17:in `block (2 levels) in <top (required)>'
     # ./spec/test_class_spec.rb:17:in `block (2 levels) in <top (required)>'

Finished in 0.1797 seconds (files took 1.29 seconds to load)
1 example, 1 failure

Failed examples:

rspec ./spec/test_class_spec.rb:16 # TestClass does something

But the same code, with Rails 6.1 does not show this error:

❯ bundle exec rspec spec
.

Finished in 0.157 seconds (files took 1.71 seconds to load)
1 example, 0 failures

This repo has the following inside:

  • Rails 7.0 in main branch
  • Rails 6.1 in rails61 branch

Everything else is exactly the same.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages