-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Template stubs are not removed in Rails 7.1. #2696
Comments
Hi, I just ran into this too. After FIRST discovering I needed a I may have found an alternate build_template implementation that works however, using only Rails 7.1 public API instead of the current patchy implementation. module RSpec
module Rails
module ViewExampleGroup
module ExampleMethods
def stub_template(hash)
controller.prepend_view_path(StubResolverCache.resolver_for(hash))
end
end
end
end
end Changing the source code changes the order of tests for a given But with patched @tristandunn thanks for the repro script, interested in checking this out and confirming? I am not certain if this will solve things everywhere (is Feedback? |
…-rails that does not yet include it rspec/rspec-rails@4d65bea rspec/rspec-rails#2696
…-rails that does not yet include it rspec/rspec-rails@4d65bea rspec/rspec-rails#2696
@jrochkind Using |
Fix technically released in 6.0.4 but please use 6.1.0 for Rails 7.1 support. |
Thank you! |
Note that #2644 feels a little similar, but didn't have any luck with the suggested fix with this issue.
I did a good bit of debugging and can definitely see the resolver still listed in the view paths. I tried a few different ways to remove it manually without any luck. Also tried recreating the view paths, but I don't think I have enough Rails context to truly determine how to fix it.
What Ruby, Rails and RSpec versions are you using?
Ruby version: 3.2.2
Rails version: 7.1.0
RSpec version: main
Observed Behavior
The template stub isn't removed so the view isn't rendered correctly resulting in a test failure.
Expected Behavior
The template stub is removed so the view is rendered correctly.
Can you provide an example app?
app.rb
app/views/_example.html.erb
The text was updated successfully, but these errors were encountered: