Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Fix warning for overshadowing XML variable | Musannif Zahir | 2014-03-28 | 1 | -2/+2 |
| | |||||
* | ActiveRecord/ActiveModel '#validate' alias for 'valid?' | Henrik Nyh | 2014-03-27 | 1 | -0/+9 |
| | | | | | | | | It's unintuitive to call '#valid?' when you want to run validations but don't care about the return value. The alias in ActiveRecord isn't strictly necessary (the ActiveModel alias is still in effect), but it clarifies. | ||||
* | comment why we are modifying global state. [ci skip] | Yves Senn | 2014-03-11 | 1 | -0/+1 |
| | |||||
* | Completely remove potential global state leaks in ActiveModel tests. | Zuhao Wan | 2014-03-11 | 7 | -110/+136 |
| | | | | ActiveModel tests can now be run in random order. | ||||
* | Merge pull request #14315 from zuhao/activemodel_tests_in_random_order | Yves Senn | 2014-03-09 | 4 | -13/+39 |
|\ | | | | | Run ActiveModel test suites in random order. | ||||
| * | Run ActiveModel test suites in random order. | Zuhao Wan | 2014-03-10 | 4 | -13/+39 |
| | | | | | | | | | | | | | | | | | | | | 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. | ||||
* | | Tests for indifferent access using full_messages_for. Closes #11916 | Pavel Penkov | 2014-03-08 | 1 | -0/+7 |
|/ | |||||
* | Fix some validators when used on model instance | Eric Hutzelman | 2014-02-26 | 1 | -1/+2 |
| | | | | | | | | Now that Validator #setup is called from the initializer, we need a reference to the model's class to be passed in to allow the validators to continue functioning when used at the instance level. Closes #14134. | ||||
* | add test coverage for activemodel Dirty#reset_changes | Dmitry Polushkin | 2014-02-09 | 1 | -0/+19 |
| | |||||
* | `#to_param` returns `nil` if `to_key` returns `nil`. Closes #11399. | Yves Senn | 2014-02-04 | 1 | -0/+10 |
| | | | | | | | | | | | | | | | | The documentation of `#to_key` (http://api.rubyonrails.org/classes/ActiveModel/Conversion.html#method-i-to_key) states that it returns `nil` if there are no key attributes. `to_param` needs to be aware of that fact and return `nil` as well. Previously it raised the following exception: ``` 1) Error: ConversionTest#test_to_param_returns_nil_if_to_key_is_nil: NoMethodError: undefined method `join' for nil:NilClass /Users/senny/Projects/rails/activemodel/lib/active_model/conversion.rb:65:in `to_param' /Users/senny/Projects/rails/activemodel/test/cases/conversion_test.rb:34:in `block in <class:ConversionTest>' ``` | ||||
* | 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 | 16 | -42/+33 |
| | |||||
* | 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] | ||||
* | Some minor fixes | Godfrey Chan | 2014-01-24 | 1 | -1/+0 |
| | |||||
* | Removed old tests | Godfrey Chan | 2014-01-24 | 2 | -239/+121 |
| | |||||
* | Rewrote the tests for has_secure_password | Godfrey Chan | 2014-01-24 | 1 | -0/+181 |
| | |||||
* | Update ActiveModel::Errors.has_key? test | Adrien Coquio | 2014-01-22 | 1 | -1/+1 |
| | |||||
* | Add failing test for ActiveModel::Errors#has_key? method | Adrien Coquio | 2014-01-22 | 1 | -0/+5 |
| | | | | From the doc, this method should return false and not nil if there is no errors for this key | ||||
* | Fix typo | Rafael Mendonça França | 2014-01-21 | 1 | -1/+1 |
| | |||||
* | When applying changes or reseting changes create the right class | Rafael Mendonça França | 2014-01-20 | 1 | -0/+8 |
| | | | | | | | Before this patch after the changes are applied the changes can be only accessed using string keys, but before symbols are also accepted. After this change every state of the model will be consistent. | ||||
* | Change all "can not"s to the correct "cannot". | T.J. Schuck | 2014-01-03 | 1 | -33/+33 |
| | |||||
* | Merge pull request #13131 from gja/changed-accepts-values | Godfrey Chan | 2013-12-30 | 1 | -0/+10 |
|\ | | | | | Allows you to check if a field has changed to a particular value | ||||
| * | Allows you to check if an attribute has changed to a particular value | Tejas Dinkar | 2013-12-15 | 1 | -0/+10 |
| | | | | | | | | model.name_changed?(from: "Pete", to: "Ringo") | ||||
* | | Disable locale checks to avoid warnings in Active Model tests [ci skip] | Carlos Antonio da Silva | 2013-12-23 | 1 | -0/+3 |
|/ | | | | | Missed AMo when adding to the other components in ae196e85ee7169700afac2eecdc276bc06b10b8d. | ||||
* | Merge pull request #13273 from robertomiranda/test-remove-require | Guillermo Iguaran | 2013-12-11 | 1 | -1/+0 |
|\ | | | | | Remove require 'models/administrator', Administrator is not used in secure password test | ||||
| * | Remove require 'models/administrator', Administrator is not used in secure ↵ | robertomiranda | 2013-12-11 | 1 | -1/+0 |
| | | | | | | | | password test | ||||
* | | 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 bcrypt's public cost attr, not internal constant | T.J. Schuck | 2013-10-10 | 1 | -0/+8 |
| | | | | | | | | | | | | | | | | See: - https://github.com/codahale/bcrypt-ruby/pull/63 - https://github.com/codahale/bcrypt-ruby/pull/64 - https://github.com/codahale/bcrypt-ruby/pull/65 | ||||
* | | Merge pull request #8791 from griffinmyers/master | Rafael Mendonça França | 2013-10-03 | 1 | -1/+16 |
|\ \ | | | | | | | | | | | | | | | | | | | Updated DirtyModel's @changed_attributes hash to be symbol/string agnostic Conflicts: activemodel/CHANGELOG.md | ||||
| * | | DirtyModel uses a hash to keep track of any changes made to attributes | William Myers | 2013-05-27 | 1 | -1/+16 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | of an instance. When using the attribute_will_change! method, you must supply a string and not a symbol or the *_changed? method will break (because it is looking for the attribute name as a string in the keys of the underlying hash). To remedy this, I simply made the underlying hash a HashWithIndifferentAccess so it won't matter if you supply the attribute name as a symbol or string to attribute_will_change!. | ||||
* | | | Merge pull request #10816 from bogdan/less-dirty-dirty | Rafael Mendonça França | 2013-09-23 | 1 | -2/+1 |
| | | | | | | | | | | | | Make AM::Dirty less dirty to plugin into AR or other library | ||||
* | | | use assert_empty in activemodel conditional validation test cases | Rajarshi Das | 2013-09-10 | 1 | -7/+7 |
| | | | |||||
* | | | fix actionview and activemodel test cases typos | Rajarshi Das | 2013-09-05 | 1 | -1/+1 |
| | | | |||||
* | | | remove unused instance variable | Rajarshi Das | 2013-08-23 | 1 | -2/+1 |
| | | | |||||
* | | | Dont' check for any order in hash since we aren't sorting it and this is ↵ | Guillermo Iguaran | 2013-08-18 | 1 | -11/+0 |
| | | | | | | | | | | | | determinated only by the used interpreter | ||||
* | | | Refactor serialization test for hash order | Guillermo Iguaran | 2013-08-18 | 1 | -7/+6 |
| | | | |||||
* | | | Avoid Skip in test, have a unified test for order | Gaurish Sharma | 2013-08-09 | 1 | -10/+7 |
| | | | |||||
* | | | Add tests for ActiveModel::Serializers::JSON#as_json ordering | Gaurish Sharma | 2013-08-09 | 1 | -1/+10 |
| |/ |/| | |||||
* | | fix tests | Max Shytikov | 2013-07-30 | 1 | -1/+1 |
| | | |||||
* | | Fix secure_password password_confirmation validations | Vladimir Kiselev | 2013-07-24 | 1 | -0/+5 |
| | | |||||
* | | Remove redundant escapes from xml serialization test | Vipul A M | 2013-07-01 | 1 | -6/+6 |
| | | |||||
* | | Remove deprecation warning from AttributeMethodsMatcher | Paul Nikitochkin | 2013-06-28 | 1 | -11/+0 |
| | | |||||
* | | Remove deprecated attr_protected/accessible | Łukasz Strzałkowski | 2013-06-27 | 1 | -16/+0 |
| | | | | | | | | Rails 4.0 has removed attr_protected and attr_accessible feature in favor of Strong Parameters. | ||||
* | | Merge pull request #10774 from ↵ | Carlos Antonio da Silva | 2013-06-25 | 1 | -0/+1 |
|\ \ | | | | | | | | | | | | | | | | | | | | | | chuckbergeron/validates-inclusion-of-accuracy-for-non-numeric-ranges Greater accuracy for validates_inclusion_of on non-numeric ranges Closes #10774, fixes #10593 | ||||
| * | | 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 | ||||
* | | | ActiveModel::Model inclusion chain backward compatibility | Fred Wu | 2013-06-20 | 1 | -5/+15 |
| | | | |||||
* | | | Fixes AciveModel::Model with no ancestors, fixes #11004 | Fred Wu | 2013-06-19 | 1 | -2/+23 |
| | | | | | | | | | | | | Signed-off-by: José Valim <jose.valim@plataformatec.com.br> | ||||
* | | | Fixed ActiveModel::Model's inclusion chain | Fred Wu | 2013-06-19 | 1 | -0/+12 |
| | | | |||||
* | | | Stub logger for tests | Andrey Koleshko | 2013-06-06 | 1 | -0/+4 |
| | | |