it3s / meppit

3 stars 1 forks source link

Use I18n translations in rspec tests #14

Closed LuizArmesto closed 10 years ago

LuizArmesto commented 10 years ago

The hardcoded strings from specs should be replaced by i18n translations to eradicate non-determinism in tests.

Example:

User validates length of password
     Failure/Error: expect(user.errors[:password].first).to eq 'is too short (minimum is 6 characters)'

       expected: "is too short (minimum is 6 characters)"
            got: "é muito curto (mínimo é 6 caracteres)"

       (compared using ==)
     # ./spec/models/user_spec.rb:31:in `block (2 levels) in <top (required)>'