Commit message (Collapse) | Author | Age | Files | Lines | ||
---|---|---|---|---|---|---|
... | ||||||
* | | Revert "Merge pull request #21069 from ↵ | Rafael Mendonça França | 2015-09-07 | 1 | -19/+0 | |
| | | | | | | | | | | | | | | | | | | dmitry/feature/validate-multiple-contexts-at-once" This reverts commit 51dd2588433457960cca592d5b5dac6e0537feac, reversing changes made to ecb4e4b21b3222b823fa24d4a0598b1f2f63ecfb. This broke Active Record tests | |||||
* | | Merge pull request #21069 from dmitry/feature/validate-multiple-contexts-at-once | Rafael Mendonça França | 2015-09-07 | 1 | -0/+19 | |
|\ \ | | | | | | | | | | Validate multiple contexts on `valid?` and `invalid?` at once | |||||
| * | | Validate multiple contexts on `valid?` and `invalid?` at once. | Dmitry Polushkin | 2015-07-30 | 1 | -0/+19 | |
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Example: ```ruby class Person include ActiveModel::Validations attr_reader :name, :title validates_presence_of :name, on: :create validates_presence_of :title, on: :update end person = Person.new person.valid?([:create, :update]) # => true person.errors.messages # => {:name=>["can't be blank"], :title=>["can't be blank"]} ``` | |||||
* | | Add missing test for #17351 | Aditya Kapoor | 2015-09-01 | 1 | -0/+14 | |
| | | ||||||
* | | pass the correct argument to mock on a test of `validates_length_of` | yuuji.yaginuma | 2015-07-28 | 1 | -1/+1 | |
|/ | ||||||
* | Removes unnecessary comments from i18n validations tests [ci skip] | Zamith | 2015-07-11 | 1 | -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 activemodel | Zamith | 2015-07-11 | 1 | -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 Hansen | 2015-07-10 | 2 | -35/+32 | |
| | | | | Also fix Minitest constant reference. | |||||
* | Improve Validation Helpers' documentation comments and tests | Radan Skoric | 2015-06-27 | 2 | -0/+31 | |
| | ||||||
* | Fix typo in AM I18n validation test name [skip ci] | Anton Davydov | 2015-06-09 | 1 | -1/+1 | |
| | ||||||
* | Remove use of mocha from Active Model | Roque Pinel | 2015-05-28 | 2 | -35/+71 | |
| | ||||||
* | Deprecate the `:tokenizer` option to `validates_length_of` | Sean Griffin | 2015-03-29 | 1 | -4/+16 | |
| | | | | | | | | As demonstrated by #19570, this option is severely limited, and satisfies an extremely specific use case. Realistically, there's not much reason for this option to exist. Its functionality can be trivially replicated with a normal Ruby method. Let's deprecate this option, in favor of the simpler solution. | |||||
* | Deprecate `ActiveModel::Errors` `add_on_empty` and `add_on_blank` methods | Wojciech Wnętrzak | 2015-02-19 | 1 | -1/+1 | |
| | | | | without replacement. | |||||
* | Merge pull request #16381 from kakipo/validate-length-tokenizer | Rafael Mendonça França | 2015-02-13 | 1 | -0/+13 | |
|\ | | | | | | | Allow symbol as values for `tokenizer` of `LengthValidator` | |||||
| * | Allow symbol as values for `tokenize` of `LengthValidator` | kakipo | 2014-08-03 | 1 | -0/+13 | |
| | | ||||||
* | | Removed magic comments # encoding: utf-8 , since its default from ruby 2.0 ↵ | Vipul A M | 2015-02-03 | 15 | -16/+0 | |
| | | | | | | | | onwards. | |||||
* | | Merge pull request #18439 from mokhan/validates-acceptance-of-array | Sean Griffin | 2015-01-12 | 1 | -0/+6 | |
|\ \ | | | | | | | allow '1' or true for acceptance validation. | |||||
| * | | allow '1' or true for acceptance validation. | mo khan | 2015-01-10 | 1 | -0/+6 | |
| | | | ||||||
* | | | Add test for AM::Validation::Callbacks with :on | claudiob | 2015-01-11 | 1 | -0/+26 | |
|/ / | | | | | | | | | | | | | | | | | | | | | `before_validation` and `after_validation` from ActiveModel::Validation::Callbacks accept an optional `:on` parameter that was not previously documented or tested. For instance given before_validation :do_something, on: :create then `object.valid?(:create)` will invoke `:do_something` while `object.valid?` or `object.valid?(:anything_else)` will not. | |||||
* | | Deprecate `false` as the way to halt AM validation callbacks | claudiob | 2015-01-02 | 1 | -3/+17 | |
| | | | | | | | | | | | | | | | | | | | | Before this commit, returning `false` in an ActiveModel validation callback such as `before_validation` would halt the callback chain. After this commit, the behavior is deprecated: will still work until the next release of Rails but will also display a deprecation warning. The preferred way to halt a callback chain is to explicitly `throw(:abort)`. | |||||
* | | Add AM test for after_validation returning false | claudiob | 2014-12-14 | 1 | -2/+13 | |
| | | | | | | | | | | | | | | | | This stems from https://github.com/rails/rails/pull/17227#discussion_r21641358 It's simply a clarification of the current behavior by which if an `after_validation` ActiveModel callback returns +false+, then further `after_` callbacks **are not halted**. | |||||
* | | Pass symbol as an argument instead of a block | Erik Michaels-Ober | 2014-11-29 | 1 | -2/+2 | |
| | | ||||||
* | | Remove redundant require of file | Adam89 | 2014-11-01 | 1 | -1/+0 | |
|/ | | | | | This file was required inside 'test/validators/namespace/email_validator.rb' that's already required here. Therefore I removed the redundant required. | |||||
* | `only_integer` of `NumericalityValidator` now allows procs and symbols | Robin Mehner | 2014-06-22 | 1 | -0/+15 | |
| | ||||||
* | Correct typo, add test for validates_absence_of, correct method names | Akshay Vishnoi | 2014-06-16 | 1 | -3/+4 | |
| | ||||||
* | Add singular and plural form for some validation messages | Abd ar-Rahman Hamidi | 2014-05-02 | 1 | -3/+15 | |
| | ||||||
* | Completely remove potential global state leaks in ActiveModel tests. | Zuhao Wan | 2014-03-11 | 2 | -9/+11 | |
| | | | | ActiveModel tests can now be run in random order. | |||||
* | Run ActiveModel test suites in random order. | Zuhao Wan | 2014-03-10 | 2 | -6/+10 | |
| | | | | | | | | | | 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 everywhere to reset validators in tests | Kuldeep Aggarwal | 2014-01-28 | 1 | -1/+1 | |
| | ||||||
* | Use the new clear_validators! api to reset validators in tests | Carlos Antonio da Silva | 2014-01-27 | 15 | -34/+32 | |
| | ||||||
* | Merge tests about multiple validation contexts | Carlos Antonio da Silva | 2014-01-27 | 1 | -10/+6 | |
| | ||||||
* | Ability to specify multiple contexts when defining a validation. | Vince Puzzella | 2014-01-27 | 1 | -0/+16 | |
| | | | | | | Example: validates_presence_of :name, on: [:update, :custom_validation_context] | |||||
* | Let validates_inclusion_of accept Time and DateTime ranges | Akira Matsuda | 2013-10-23 | 1 | -0/+22 | |
| | | | | fixes 4.0.0 regression introduced in 0317b93c17a46d7663a8c36edc26ad0ba3d75f85 | |||||
* | use assert_empty in activemodel conditional validation test cases | Rajarshi Das | 2013-09-10 | 1 | -7/+7 | |
| | ||||||
* | Use Range#cover? for Numeric ranges (tests via endpoints) and use ↵ | Charles Bergeron | 2013-05-27 | 1 | -0/+1 | |
| | | | | | | Range#include? for non-numeric ranges added changelog message | |||||
* | deprecate Validator#setup (to get rid of a respond_to call). validators do ↵ | Nick Sutterer | 2013-05-23 | 1 | -23/+1 | |
| | | | | their setup in their constructor now. | |||||
* | Convert ActiveModel to 1.9 hash syntax. | Patrick Robertson | 2013-05-01 | 12 | -202/+201 | |
| | | | | | I also attempted to fix other styleguide violations such as { a: :b } over {a: :b} and foo(b: 'bar') over foo( b: 'bar' ). | |||||
* | Merge pull request #10286 from ↵ | Carlos Antonio da Silva | 2013-04-21 | 1 | -2/+2 | |
|\ | | | | | | | | | neerajdotname/fix-wrong-test-name-and-failure-message fix wrong test description and failure message | |||||
| * | fix wrong test description and failure message | Neeraj Singh | 2013-04-21 | 1 | -2/+2 | |
| | | ||||||
* | | Added tests for if condition in Active Model callbacks | Neeraj Singh | 2013-04-21 | 1 | -0/+21 | |
|/ | ||||||
* | fix some typos found in activemodel | Vipul A M | 2013-03-18 | 1 | -1/+1 | |
| | ||||||
* | `validates_confirmation_of` does not override writer methods. | Yves Senn | 2013-03-04 | 1 | -0/+31 | |
| | ||||||
* | Take care of whitespaces and changing the hash syntax | Rafael Mendonça França | 2013-02-04 | 1 | -57/+56 | |
| | ||||||
* | test for issue 8931 | David | 2013-02-02 | 1 | -0/+8 | |
| | ||||||
* | Add CHANGELOG entry for #8622 | Rafael Mendonça França | 2012-12-26 | 1 | -2/+2 | |
| | ||||||
* | Revert the change at ActiveModel::Errors#add_on_blank and fix in the | Rafael Mendonça França | 2012-12-26 | 1 | -5/+5 | |
| | | | | | | | | | | | right place. The EachValidator#validate already handle :allow_blank and :allow_nil, correctly. Closes #8622. Fix #8621. | |||||
* | Tests and fix for validates_presence of :allow_nil, :allow_blank | Colin Kelley | 2012-12-26 | 1 | -0/+34 | |
| | | | | | Conflicts: activemodel/lib/active_model/errors.rb | |||||
* | Add `ActiveModel::Validations::AbsenceValidator`, a validator to check the ↵ | Roberto Vasquez Angel | 2012-12-15 | 1 | -0/+67 | |
| | | | | | | absence of attributes. Add `ActiveModel::Errors#add_on_present` method. Adds error messages to present attributes. | |||||
* | Length validation handles correctly nil. Fix #7180 | Michal Zima | 2012-11-26 | 1 | -0/+39 | |
| | | | | When nil or empty string are not allowed, they are not valid. | |||||
* | use Array() instead flatten | Vasiliy Ermolovich | 2012-11-05 | 1 | -20/+0 | |
| | | | | | * move ActiveModel::Errors tests to errors_test.rb * add spec coverage for add_on_empty and add_on_blank |