Skip to content
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

rails 7.1 stub_template issue: undefined method `unshift' for #<ActionView::PathSet #2691

Closed
olleolleolle opened this issue Oct 6, 2023 · 4 comments

Comments

@olleolleolle
Copy link
Contributor

olleolleolle commented Oct 6, 2023

What Ruby, Rails and RSpec versions are you using?

Ruby version: 3.2.2
Rails version: 7.1.0
RSpec version: 3.12.2

Observed behaviour

When my code ran stub_template, it ran and failed on not having the expected method:

     NoMethodError:
       undefined method `unshift' for #<ActionView::PathSet:0x00007ff07ce79d88 @paths=[#<ActionView::FileSystemResolver:0x00007ff07ce79ef0 @unbound_templates=#<Concurrent::Map:0x00007ff07ce79ec8 entries=0 default_proc=nil>, @path_parser=#<ActionView::Res
olver::PathParser:0x00007ff094f38e78>, @path="/home/olle/projects/myapp/views">, #<ActionView::FileSystemResolver:0x00007ff07ce7ac38 @unbound_templates=#<Concurrent::Map:0x00007ff07ce7ab98 entries=0 default_proc=nil>, @path_parser=#<Actio
nView::Resolver::PathParser:0x00007ff094f38ea0>, @path="/home/olle/.devbox/code/gems/gems/view_component-3.6.0/app/views">]>
     # /home/olle/.devbox/code/gems/gems/rspec-rails-6.0.3/lib/rspec/rails/example/view_example_group.rb:92:in `stub_template'

Expected behaviour

I expected the stub_template to... work like before, stubbing a template.

Can you provide an example app?

Not right now, but perhaps soon.

@olleolleolle olleolleolle changed the title rails 7.1 stub_template issue: unshift not defined rails 7.1 stub_template issue: undefined method `unshift' for #<ActionView::PathSet Oct 6, 2023
@JonRowe
Copy link
Member

JonRowe commented Oct 6, 2023

This should have already been fixed in #2685 can you give main a shot?

@olleolleolle
Copy link
Contributor Author

@JonRowe Thank you, yes, can confirm, this fixes that issue for me!

@JonRowe
Copy link
Member

JonRowe commented Oct 6, 2023

Thanks for confirmation, I'm aiming to ship at least an rc of the next version of rspec-rails asap

@jpalermo
Copy link

jpalermo commented Nov 1, 2023

Any update @JonRowe on when that RC or next release might happen?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants