aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/cases/validations/i18n_validation_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Call human_attribute_name with a string instead of a symboleMartin Larochelle2018-08-161-1/+1
|
* `ActiveModel.full_message` interaction with `index_errors`Martin Larochelle2018-08-141-0/+57
|
* Add global config for config.active_model.i18n_full_messageMartin Larochelle2018-06-051-0/+23
|
* Allow to override the full_message error formatMartin Larochelle2018-05-221-0/+36
|
* Use frozen string literal in activemodel/Kir Shatrov2017-07-161-0/+2
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Fix broken comments indentation caused by rubocop auto-correct [ci skip]Ryuta Kamizono2016-09-141-1/+1
| | | | | | All indentation was normalized by rubocop auto-correct at 80e66cc4d90bf8c15d1a5f6e3152e90147f00772. But comments was still kept absolute position. This commit aligns comments with method definitions for consistency.
* Add three new rubocop rulesRafael Mendonça França2016-08-161-5/+5
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* applies remaining conventions across the projectXavier Noria2016-08-061-1/+0
|
* applies new string literal convention in activemodel/testXavier Noria2016-08-061-41/+41
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* pass the correct argument to mock on a test of `validates_length_of`yuuji.yaginuma2015-07-281-1/+1
|
* Removes unnecessary comments from i18n validations tests [ci skip]Zamith2015-07-111-61/+2
| | | | | | These comments do not add a lot to the readability, grepability or overall understanding of the tests, therefore I believe they can be safely removed.
* Remove the reference to mocha in activemodelZamith2015-07-111-27/+27
| | | | | Activemodel is no longer dependent on mocha, so we can make the comments more generic.
* Use private method call assertions in Active Model tests.Kasper Timm Hansen2015-07-101-34/+31
| | | | Also fix Minitest constant reference.
* Fix typo in AM I18n validation test name [skip ci]Anton Davydov2015-06-091-1/+1
|
* Remove use of mocha from Active ModelRoque Pinel2015-05-281-32/+66
|
* Removed magic comments # encoding: utf-8 , since its default from ruby 2.0 ↵Vipul A M2015-02-031-2/+0
| | | | onwards.
* Run ActiveModel test suites in random order.Zuhao Wan2014-03-101-0/+1
| | | | | | | | | | This gets the whole ActiveModel test suites working even if `self.i_suck_and_my_tests_are_order_dependent!` is disabled in `ActiveSupport::TestCase`. Two places are found that potentially leak global state. This patch makes sure states are restored so that none of the changes happen in a single test will be carried over to subsequence tests.
* Use the new clear_validators! api to reset validators in testsCarlos Antonio da Silva2014-01-271-2/+2
|
* Convert ActiveModel to 1.9 hash syntax.Patrick Robertson2013-05-011-59/+58
| | | | | I also attempted to fix other styleguide violations such as { a: :b } over {a: :b} and foo(b: 'bar') over foo( b: 'bar' ).
* use Array() instead flattenVasiliy Ermolovich2012-11-051-20/+0
| | | | | * move ActiveModel::Errors tests to errors_test.rb * add spec coverage for add_on_empty and add_on_blank
* Don't pass `:within` option to the i18nRafael Mendonça França2012-07-201-0/+22
|
* prevent users from unknowingly using bad regexps that can compromise ↵MrBrdo2012-06-141-2/+2
| | | | security (http://homakov.blogspot.co.uk/2012/05/saferweb-injects-in-various-ruby.html)
* Support i18n attributes for confirmationBrian Cardarella2012-04-241-1/+1
|
* confirmation validation error attributeBrian Cardarella2012-04-231-6/+11
| | | | | | | | | | | | This will render the error message on :#{attribute}_confirmation instead of on attribute itself. When rendering confirmation errors inline on the form with form builders such as SimpleForm and Formtastic it is confusing to the ender user to see the confirmation error message on the attribute element. Instead it makes more sense to have this validation error render on the confirmation field instead. The i18n message has been updated for the confirmation validator error message to include the original attribute name.
* Revert "Properly interpolate i18n keys in modules [#5572 state:resolved]"Santiago Pastorino2011-02-271-19/+0
| | | | | | | This breaks #6448, you should use :"module/class" as key for namespacing [#6448 state:committed] This reverts commit 8d30193b08bd2321a7a78a1f481bd5e4d4d45557.
* Properly interpolate i18n keys in modules [#5572 state:resolved]Rodrigo Rosenfeld Rosas2010-09-241-0/+19
|
* Make ActiveModel::Errors#add_on_blank and #add_on_empty accept an options ↵Jeroen van Dijk2010-06-211-338/+169
| | | | | | | | | | | | | | | | hash and make various Validators pass their (filtered) options. This makes it possible to pass additional options through Validators to message generation. E.g. plugin authors want to add validates_presence_of :foo, :format => "some format". Also, cleanup the :default vs :message options confusion in ActiveModel validation message generation. Also, deprecate ActiveModel::Errors#add_on_blank(attributes, custom_message) in favor of ActiveModel::Errors#add_on_blank(attributes, options). Also, refactoring of ActiveModel and ActiveRecord Validation tests. Test are a lot more DRY now. Better test coverage as well now. The first four points were reapplied from an older patch of Sven Fuchs which didn't apply cleanly anymore and was not complete yet. Signed-off-by: José Valim <jose.valim@gmail.com>
* removed AR from all AMo tests, including any unneeded files (schema, ↵Josh Kalderimis2010-05-091-3/+1
| | | | fixtures and test helper)
* Favor %{} in all code instead of (deprecated) {{}} as interpolation syntax ↵Lawrence Pit2010-05-031-1/+1
| | | | | | for I18n Signed-off-by: José Valim <jose.valim@gmail.com>
* Fix validates_numericaly_of only integer error message [#4406 state:resolved]reu2010-04-251-9/+9
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* errors.rb needs to be declared as UTF-8 [#3941 state:resolved]Aaron Patterson2010-04-021-0/+10
| | | | Signed-off-by: wycats <wycats@gmail.com>
* Drop AR I18n deprecation and simple use errors.messages as fallback.José Valim2010-01-301-14/+14
|
* Be sure to dup load paths before clearing the array.José Valim2010-01-071-1/+1
|
* Errors messages are now moved from :activerecord.errors to simply :errors on ↵José Valim2010-01-071-44/+44
| | | | I18n yml files.
* Remove deprecated ActiveModel tests (%d and %s is no longer supported in ↵José Valim2010-01-021-14/+0
| | | | error messages a couple months already)
* Use activerecord.errors.format as in Rails 2.3.5.José Valim2010-01-021-0/+6
|
* Be sure to convert namespaced names to we have 'Parrots name' instead of ↵José Valim2010-01-021-1/+1
| | | | 'Parrots.name' in error messages.
* No need to use ValidationsRepairHelper hack on ActiveModel anymore, ↵José Valim2009-12-231-1/+0
| | | | Model.reset_callbacks(:validate) is enough. However, tests in ActiveRecord are still coupled, so moved ValidationsRepairHelper back there.
* Move validator, human_name and human_attribute_name to ActiveModel, remove ↵José Valim2009-10-201-0/+8
| | | | | | deprecated error messages and add i18n_scope and lookup_ancestors. Signed-off-by: Carl Lerche <carllerche@mac.com>
* Changed ActiveRecord to use new callbacks and speed up observers by only ↵José Valim2009-09-081-10/+3
| | | | | | notifying events that are actually being consumed. Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Fix warnings in AMoJoshua Peek2009-09-051-45/+1
|
* Merge branch 'master' into active_modelJoshua Peek2009-05-291-20/+8
| | | | | | | | | | | Conflicts: activemodel/lib/active_model/core.rb activemodel/test/cases/state_machine/event_test.rb activemodel/test/cases/state_machine/state_transition_test.rb activerecord/lib/active_record/validations.rb activerecord/test/cases/validations/i18n_validation_test.rb activeresource/lib/active_resource.rb activeresource/test/abstract_unit.rb
* Add I18n translations to ActiveModel and move more AR specific parts to ↵Pratik Naik2009-03-201-356/+275
| | | | ActiveRecord::Validations
* Deprecate Error#on(attribute) in favour of Errors#[attribute]Pratik Naik2009-03-201-30/+30
|
* TestDatabase -> TestsDatabasePratik Naik2009-03-201-1/+1
|
* Move relevant validation tests from Active Record to Active ModelPratik Naik2009-03-201-0/+672