Skip to content
This repository

ActionView::TestCase, helper that uses asset_path #7534

Open
jrochkind opened this Issue September 05, 2012 · 9 comments

7 participants

Jonathan Rochkind Steve Klabnik BrandonMathis Nikita Afanasenko Yves Senn Pedro Nascimento Rafael Mendonça França
Jonathan Rochkind

I have an ordinary helper module that has a method, where part of it's implementation calls the #asset_path helper. This works fine.

I have an ActionView::TestCase that tests/calls this helper. This generally works fine, unless it tries to call the helper method that calls asset_path.

I get a:

undefined method `asset_path' for #<BentoSearchHelperTest:0x0000000f9aefc0>
.../actionpack-3.2.8/lib/action_dispatch/testing/assertions/routing.rb:176:in `method_missing'
..../actionpack-3.2.8/lib/action_view/test_case.rb:236:in `method_missing'

As you can see I'm using rails 3.2.8.

I believe this is a bug. But correct me if I'm wrong and I'm doing something wrong or something.

Steve Klabnik
Collaborator

Hmmm. I am not sure. @pixeltrix are the url helpers included in ActionView::TestCase? Should they be?

BrandonMathis

I'm able to reproduce this in 3.2.8

https://gist.github.com/4035922

Nikita Afanasenko

AssetUrlHelper is not included in ActionView::Helpers in 3-2-stable, but it's already fixed in master (@9fa1a54). So it should be ok to include it in 3-2-stable too.

BrandonMathis

I still seeing this issue in 3.2.9rc2 Not sure if it is fixed in edge since I am having some issues installing from edge at the moment but I believe the commit you pointed to is merged in with the 3.2.3-stable branch.

Yves Senn
Collaborator
senny commented March 17, 2013

related to #7218

Pedro Nascimento

What is the current status? Should we add the Asset URL helpers to ActionView::Helpers in 3.2.x or is it okay to leave it as it is? Should we close this one (and the related issue), or do we welcome a pull request?

Rafael Mendonça França

We can fix this one

Pedro Nascimento

Is it safe to just backport the commit?

Rafael Mendonça França

@lunks unfortunately not. That commit change show sprockets glue with Rails to make possible to us extract sprockets-rails.

Pedro Nascimento lunks referenced this issue from a commit September 22, 2013
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.