rspec / rspec-rails

RSpec for Rails 7+
https://rspec.info
MIT License
5.19k stars 1.04k forks source link

Prepend controller path to lookup_context prefixes #2749

Open sfnelson opened 8 months ago

sfnelson commented 8 months ago

Rails rendering assumes that the first prefix encountered is 'special', specifically, it's the controller's prefix. This can be seen in ActionView::AbstractRenderer::ObjectRendering#initialize. This change injects the controller path at the start of the prefix list instead of the end to make sure this assumption is satisfied.

Resolves #2729.

JonRowe commented 7 months ago

:wave: Can you rebase this?