Open
Description
What Ruby, Rails and RSpec versions are you using?
Ruby version: ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
Rails version: 7.0.3
RSpec version:
RSpec 3.11
- rspec-core 3.11.0
- rspec-expectations 3.11.0
- rspec-mocks 3.11.1
- rspec-rails 5.1.2
- rspec-support 3.11.0
Observed behaviour
When:
- having two controller tests of the same controller
- both tests are invoked
- a config-based before hook happens to call
skip
for the first test
Then:
- The second test fails, unable to find a view
When running the failing test independently, it passes:
Expected behaviour
In both scenarios the second test should pass, or at least behave consistently
Can you provide an example app?
Commands to run are included in repo's README.md
What I discovered
- by adding some debugging statements to ActionView::ViewPaths I confirmed that paths are set to empty array for the failing scenario
- by following the backtrace I discovered that the RSpec::Rails::ViewRendering may be involved and that enabling
render_views
can be used as a workaround
Metadata
Metadata
Assignees
Labels
No labels