I am trying to test my application_helper methods, and some of them are
calling ApplicationController methods
class ApplicationHelperTest < Test::Unit::TestCase
...
test 'test_copyrights' do
assert_equal @subdomain[:name], copyright
end
class ApplicationController < ActionController::Base
helper_method :current_subdomain
def current_subdomain
...
end
...
end
but the test is failing :
NameError: undefined local variable or method `current_subdomain'
how can I test it ? ( where... in unit/functional/integration test ?
and
how to access the ApplicationController methods ?)
thanks for feedback
Rails 3.2 - test for application_helper.rb fails when trying to access application_controller method
on 2012-11-27 08:05
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.