Forum: Ruby on Rails Rails 3.2 - test for application_helper.rb fails when trying to access application_controller method

Posted by Kad Kerforn (kadoudal)
on 2012-11-27 08:05
(Received via mailing list)
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
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
No account? Register here.