Skip to content

Rails 7.0.0.rc1 view specs fail. #2539

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

Closed
jcoyne opened this issue Dec 7, 2021 · 3 comments
Closed

Rails 7.0.0.rc1 view specs fail. #2539

jcoyne opened this issue Dec 7, 2021 · 3 comments

Comments

@jcoyne
Copy link

jcoyne commented Dec 7, 2021

I have a view spec that runs fine in Rails 6, but after upgrading to Rails 7, it reports an ActionView::MissingTemplateException

Failures:

  1) catalog/facet.html.erb has the facet title
     Failure/Error: render

     ActionView::MissingTemplate:
       Missing template catalog/facet with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>["erb"]}.

       Searched in:
         * "catalog/_facet_pagination.html.erb"
         * "/Users/jcoyne85/workspace/projectblacklight/blacklight/.internal_test_app/app/views"
         * "/Users/jcoyne85/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/bundler/gems/devise-8593801130f2/app/views"
         * "/Users/jcoyne85/workspace/projectblacklight/blacklight/app/views"
         * "/Users/jcoyne85/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/view_component-2.46.0/app/views"
         * "/Users/jcoyne85/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/kaminari-core-1.2.1/app/views"
         * "/Users/jcoyne85/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actiontext-7.0.0.rc1/app/views"
         * "/Users/jcoyne85/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/actionmailbox-7.0.0.rc1/app/views"
     # ./spec/views/catalog/facet.html.erb_spec.rb:21:in `block (2 levels) in <top (required)>'

Top 1 slowest examples (0.20789 seconds, 99.4% of total time):
  catalog/facet.html.erb has the facet title
    0.20789 seconds ./spec/views/catalog/facet.html.erb_spec.rb:20

Finished in 0.20907 seconds (files took 5.61 seconds to load)
1 example, 1 failure

Failed examples:

rspec ./spec/views/catalog/facet.html.erb_spec.rb:20 # catalog/facet.html.erb has the facet title

However the file exists in the search path:

 $ ls /Users/jcoyne85/workspace/projectblacklight/blacklight/app/views/catalog/facet.html.erb
/Users/jcoyne85/workspace/projectblacklight/blacklight/app/views/catalog/facet.html.erb

This can be minimally reduced to:

# spec/views/catalog/facet.html.erb_spec.rb

RSpec.describe 'catalog/facet.html.erb' do
  it "has the facet title" do
    render
  end
end
@pirj
Copy link
Member

pirj commented Dec 7, 2021

Thanks for reporting. This is handled in #2521.

@pirj pirj closed this as completed Dec 7, 2021
@hbriggs
Copy link

hbriggs commented Jan 19, 2022

Hi @jcoyne & @pirj , I discovered this (and the linked #2521 PR) after I ran into the same issue as Justin upgrading to rails 7. Is there a fix or workaround for this?

@hbriggs
Copy link

hbriggs commented Jan 19, 2022

nvm :) discovered i could remove the extension from all our specs and things worked fine:

Screen Shot 2022-01-19 at 2 19 20 PM

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