This project is archived and is in readonly mode.

#3490 ✓invalid
michalb82

functional testing with validation with full_messages

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

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).

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages