UnitTesting-Action view testcase is failed

Hi,

I run the “Unit testing”, Then The “Actionview::Testcase” is failed. i.e
i am getting the error as below,

  1. Error:
    test_tablename(ActionView::TestCase):
    TypeError: wrong argument type Class (expected Module)
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/helpers.rb:76:in
    include' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/helpers.rb:76:inadd_template_helper’
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/helpers.rb:76:in
    module_eval' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/helpers.rb:76:inadd_template_helper’
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/helpers.rb:118:in
    helper' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/helpers.rb:115:ineach’
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/helpers.rb:115:in
    helper' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_view/test_case.rb:104:ininclude_helper_modules!’
    /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_view/test_case.rb:59:in
    send' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_view/test_case.rb:59:insetup_with_controller’
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:178:in
    send' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:178:inevaluate_method’
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:166:in
    call' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:90:inrun’
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:90:in
    each' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:90:insend’
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:90:in
    run' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:276:inrun_callbacks’
    /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/testing/setup_and_teardown.rb:60:in
    run' /usr/local/lib/ruby/1.8/test/unit/testsuite.rb:34:inrun’
    /usr/local/lib/ruby/1.8/test/unit/testsuite.rb:33:in each' /usr/local/lib/ruby/1.8/test/unit/testsuite.rb:33:inrun’
    /usr/local/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:46:in
    `run_suite’

Can anybody have an idea plz?

Thanks & Regards,
Periyasamy.R

On Mar 22, 9:43 am, Periyasamy R. [email protected]
wrote:

Hi,

I run the “Unit testing”, Then The “Actionview::Testcase” is failed. i.e
i am getting the error as below,

At a random guess I’d guess that one of your view helpers is a class
rather than a module.

Fred

On Mar 22, 11:44 am, Periyasamy R. [email protected]
wrote:

sorry Fred!. I couldn’t understand what do you say?. Could you give more
details?.

My module name is like “test_results”. Is this incorrect?

That’s ok, but is it actually a module rather than a class?

Fred

Please reply.

Okay i will mention the Model and class name details as below,

My model name is “test_instance.rb” and class name is “TestInstance”.

My Unit test file name is “test_instance_test.rb” and the class name is
“TestInstanceTest”.

When i run the unit test i am getting the error as below in
“ActionView::TestCase”

  1. Error:
    test_instances(ActionView::TestCase):
    TypeError: wrong argument type Class (expected Module)

Is this enough details?. Please reply if you have any idea.

Regards,
Periyasamy.R

That’s ok, but is it actually a module rather than a class?

Fred

Please reply.

sorry Fred!. I couldn’t understand what do you say?. Could you give more
details?.

My module name is like “test_results”. Is this incorrect?

Please reply.

-Regards,
Periyasamy.R

At a random guess I’d guess that one of your view helpers is a class
rather than a module.

Fred

Hi Fred,

Just i downgrade the rails version from 2.3.5 to 2.3.2. Now this issue
is fixed.?.

Any idea why when i use the higher version rails the problem is occured?

Regards,
Periyasamy.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs