Forum: Rails I18n problem with running functional tests( ActionView::Template)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
kiran k. (Guest)
on 2008-11-14 13:08
Hi,
     I am trying to run functional tests in my application but I am
getting following error when I am trying to the tests:


  1) Error:
test_profile_member_card_visitor_viewing_public(MembersControllerTest):
ActionView::TemplateError: undefined method `use_wrapper' for
#<#<Class:0x45cd1dc>:0x8c201c0>
    On line #1 of app/views/members/profile.rhtml

    1: <% use_wrapper :standard -%>
    2: <% show :prototype %>
    3: <% show :scriptaculous %>
    4: <% show :lytebox %>

    E:/MyAptanaProject/Community_sprint_035
Recent/app/views/members/profile.rhtml:1:in
`_run_rhtml_47app47views47members47profile46rhtml'
    E:/MyAptanaProject/Community_sprint_035
Recent/vendor/rails/actionpack/lib/action_view/base.rb:325:in `send'
    E:/MyAptanaProject/Community_sprint_035
Recent/vendor/rails/actionpack/lib/action_view/base.rb:325:in
`compile_and_render_template'
    E:/MyAptanaProject/Community_sprint_035
Recent/vendor/rails/actionpack/lib/action_view/base.rb:301:in
`render_template'
    E:/MyAptanaProject/Community_sprint_035
Recent/vendor/rails/actionpack/lib/action_view/base.rb:260:in
`render_file'
    E:/MyAptanaProject/Community_sprint_035
Recent/vendor/rails/actionpack/lib/action_controller/base.rb:812:in
`render_file'
    E:/MyAptanaProject/Community_sprint_035
Recent/vendor/rails/actionpack/lib/action_controller/base.rb:717:in
`render_with_no_layout'
    E:/MyAptanaProject/Community_sprint_035
Recent/vendor/rails/actionpack/lib/action_controller/layout.rb:247:in
`render_without_benchmar
    E:/MyAptanaProject/Community_sprint_035
Recent/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:50:in
`render_without_act
    E:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure'
    E:/MyAptanaProject/Community_sprint_035
Recent/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:50:in
`render_without_act
    E:/MyAptanaProject/Community_sprint_035
Recent/vendor/plugins/active_scaffold/lib/extensions/action_controller.rb:13:in
`render_withou
    E:/MyAptanaProject/Community_sprint_035
Recent/vendor/plugins/eons_plugins/query_stats/lib/query_stats/labeler.rb:19:in
`render'
    E:/MyAptanaProject/Community_sprint_035
Recent/vendor/rails/actionpack/lib/action_controller/base.rb:1102:in
`perform_action_without_f
    E:/MyAptanaProject/Community_sprint_035
Recent/vendor/rails/actionpack/lib/action_controller/filters.rb:696:in
`call_filters'
    E:/MyAptanaProject/Community_sprint_035
Recent/vendor/rails/actionpack/lib/action_controller/filters.rb:688:in
`perform_action_without
    E:/MyAptanaProject/Community_sprint_035
Recent/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:in
`perform_action_wit
    E:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure'
    E:/MyAptanaProject/Community_sprint_035
Recent/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:in
`perform_action_wit
    E:/MyAptanaProject/Community_sprint_035
Recent/vendor/rails/actionpack/lib/action_controller/rescue.rb:83:in
`perform_action'
    E:/MyAptanaProject/Community_sprint_035
Recent/vendor/rails/actionpack/lib/action_controller/base.rb:435:in
`send'
    E:/MyAptanaProject/Community_sprint_035
Recent/vendor/rails/actionpack/lib/action_controller/base.rb:435:in
`process_without_filters'
    E:/MyAptanaProject/Community_sprint_035
Recent/vendor/rails/actionpack/lib/action_controller/filters.rb:684:in
`process_without_sessio
    E:/MyAptanaProject/Community_sprint_035
Recent/vendor/rails/actionpack/lib/action_controller/session_management.rb:114:in
`process_wit
    E:/MyAptanaProject/Community_sprint_035
Recent/vendor/rails/actionpack/lib/action_controller/test_process.rb:15:in
`process'
    E:/MyAptanaProject/Community_sprint_035
Recent/app/controllers/application.rb:86:in `process'
    E:/MyAptanaProject/Community_sprint_035
Recent/app/controllers/application.rb:85:in `catch'
    E:/MyAptanaProject/Community_sprint_035
Recent/app/controllers/application.rb:85:in `process'
    E:/MyAptanaProject/Community_sprint_035
Recent/vendor/rails/actionpack/lib/action_controller/test_process.rb:385:in
`process'
    E:/MyAptanaProject/Community_sprint_035
Recent/vendor/rails/actionpack/lib/action_controller/test_process.rb:356:in
`get'
    members_controller_test.rb:29:in
`test_profile_member_card_visitor_viewing_public'
    E:/ruby/lib/ruby/1.8/test/unit/testcase.rb:78:in `__send__'
    E:/ruby/lib/ruby/1.8/test/unit/testcase.rb:78:in `run'
    E:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'
    E:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'
    E:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'
    E:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'
    E:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'
    E:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'
    E:/ruby/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:46:in
`run_suite'
    E:/ruby/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:67:in
`start_mediator'
    E:/ruby/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:41:in
`start'
    E:/ruby/lib/ruby/1.8/test/unit/ui/testrunnerutilities.rb:29:in `run'
    E:/ruby/lib/ruby/1.8/test/unit/autorunner.rb:216:in `run'
    E:/ruby/lib/ruby/1.8/test/unit/autorunner.rb:12:in `run'
    E:/ruby/lib/ruby/1.8/test/unit.rb:278
    members_controller_test.rb:320

               I have a member controller with me, and for member
controller profile action I have a profile page which includes some view
helpers through the application helper.(There are some files included
from application helper.)
             In above output the I have defined use_wrapper method in
one of the files included in the application helper.
             I have tried to resolve the error by including all helpers
in test helper, but no luck. Please help.
Gregory T. (Guest)
on 2009-03-23 21:48
Kiran,

I am experiencing this same problem. The methods I have defined in
ApplicationHelper (app/helpers/application_help.rb) are not available in
tests, although they do work in dev mode when I use the app via web
browser. Did you find a solution for this?

Thanks


Kiran DP wrote:
> Hi,
>      I am trying to run functional tests in my application but I am
> getting following error when I am trying to the tests:
>
>
>   1) Error:
> test_profile_member_card_visitor_viewing_public(MembersControllerTest):
> ActionView::TemplateError: undefined method `use_wrapper' for
> #<#<Class:0x45cd1dc>:0x8c201c0>
>     On line #1 of app/views/members/profile.rhtml
>
>     1: <% use_wrapper :standard -%>
>     2: <% show :prototype %>
>     3: <% show :scriptaculous %>
>     4: <% show :lytebox %>
>
>     E:/MyAptanaProject/Community_sprint_035
> Recent/app/views/members/profile.rhtml:1:in
> `_run_rhtml_47app47views47members47profile46rhtml'

 [backtrace was here...]

>     members_controller_test.rb:320
>
>                I have a member controller with me, and for member
> controller profile action I have a profile page which includes some view
> helpers through the application helper.(There are some files included
> from application helper.)
>              In above output the I have defined use_wrapper method in
> one of the files included in the application helper.
>              I have tried to resolve the error by including all helpers
> in test helper, but no luck. Please help.
This topic is locked and can not be replied to.