Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

functional testing with validation with full_messages

#3490

Rails version 2.3.4

----------- Running a functional test: --------------

Exception: translation missing: pl, activerecord, errors, models, user,
attributes, email, email_short
app/views/users/new.pl.html.erb:3

1: <h1>Rejestracja nowego użytkownika</h1>
2:
3: <%= error_messages_for :user %>
4: <% form_for :user, :url => users_path do |f| -%>
5:
6: <p><label for="login">Nazwa użytkownika

<%=req_field%>

app/views/users/new.pl.html.erb:3
app/controllers/users_controller.rb:59:in `create'
/test/functional/users_controller_test.rb:91:in `create_user'
/test/functional/users_controller_test.rb:53:in

test_should_require_email_on_signup'

/test/functional/users_controller_test.rb:52:in

test_should_require_email_on_signup'

/usr/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'
/usr/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'
/usr/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'
/usr/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'
/usr/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'
/usr/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'
/usr/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:46:in

run_suite'

/home/wojtek/workspace_galileo/.metadata/.plugins/org.rubypeople.rdt.testunit/ruby/RemoteTestRunner.rb:117:in

start_mediator'

/home/wojtek/workspace_galileo/.metadata/.plugins/org.rubypeople.rdt.testunit/ruby/RemoteTestRunner.rb:62:in

start'

/home/wojtek/workspace_galileo/.metadata/.plugins/org.rubypeople.rdt.testunit/ruby/RemoteTestRunner.rb:328

-------------- My model users.rb ------------------

validates_length_of :email, :within => 3..100, :too_short =>
:email_short, :too_long => :email_long

--------- My translations in pl.yml ------------- The below works when i use the application the standard way through WWW.
this does not get read only within test envifronment.

pl:
(...) activerecord:

(...)
errors:
  (...)
  full_messages:
    email_short: "my message 1 {{count}}"
    email_long: "my message 2 {{count}}"

(...)

---------------- QUESTION/BUG? -------------------------

How do I avoid this testing error? I am not using this translation node
" pl, activerecord, errors, models, user, attributes, email, email_short" but a full_mesage instead (cos I need a specific message,
not a {attribute} {message} pair, it will not work in my language).

Reported by michalb82 · November 17th, 2009 @ 04:59 PM

State: invalid
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. michalb82
    michalb82

    This is an issue with "translator" plugin.
    After uninstalling the plugin everything works fine.

    Sorry.

    November 18th, 2009 @ 06:12 PM

  2. Rohit Arondekar
    Rohit Arondekar
    • State changed from new to invalid
    • Importance changed from to

    October 6th, 2010 @ 06:31 AM