Search code examples
ruby-on-railsrubyruby-on-rails-5sprocketslivelock

Rails asset_path hangs in IntegrationTest


In an .html.erb file, I have <img src=<%= asset_path "logo.png" %> > and it works fine on the page. I have an integration test that renders this ERB file, and when it gets to rendering that line, the test hangs and the processor usage goes to 100% on one core.

Is this a sprockets bug? Is it likely that I have something else out of place?

Edit: Here's my test:

test 'index' do
  log_in_as(@user, 'pass')
  trans = get transactions_path
end

Solution

  • In the Gemfile, don't use sass-rails. Back then it didn't, but now it issues a "deprecated" warning imploring you to use a different sass implementation. I switched to sassc-rails to good effect on my project, but you may have to do some research to find a suitable replacement.