Skip to content

Instantly share code, notes, and snippets.

@BrandonMathis
Created November 8, 2012 01:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BrandonMathis/4035922 to your computer and use it in GitHub Desktop.
Save BrandonMathis/4035922 to your computer and use it in GitHub Desktop.
module ApplicationHelper
def test_asset_path
asset_path nil
end
end
require 'test_helper'
class ApplicationHelperTest < ActionView::TestCase
def test_path
assert_equal '/assets/', test_asset_path
end
end
Run options:
# Running tests:
E
Finished tests in 0.177110s, 5.6462 tests/s, 0.0000 assertions/s.
1) Error:
test_path(ApplicationHelperTest):
NoMethodError: undefined method `asset_path' for #<ApplicationHelperTest:0x007fd05d876c90>
/Users/bemathis/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/testing/assertions/routing.rb:176:in `method_missing'
/Users/bemathis/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/actionpack-3.2.8/lib/action_view/test_case.rb:236:in `method_missing'
/Users/bemathis/Dev/Ruby/issues/issue_7534/app/helpers/application_helper.rb:3:in `test_asset_path'
/Users/bemathis/Dev/Ruby/issues/issue_7534/test/unit/application_helper_test.rb:5:in `test_path'
1 tests, 0 assertions, 0 failures, 1 errors, 0 skips
Errors running test:units! #<RuntimeError: Command failed with status (1): [/Users/bemathis/.rbenv/versions/1.9.3-p194...]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment