aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test
Commit message (Collapse)AuthorAgeFilesLines
...
* add test coverage for activemodel Dirty#reset_changesDmitry Polushkin2014-02-091-0/+19
|
* `#to_param` returns `nil` if `to_key` returns `nil`. Closes #11399.Yves Senn2014-02-041-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 testsKuldeep Aggarwal2014-01-281-1/+1
|
* Use the new clear_validators! api to reset validators in testsCarlos Antonio da Silva2014-01-2716-42/+33
|
* Merge tests about multiple validation contextsCarlos Antonio da Silva2014-01-271-10/+6
|
* Ability to specify multiple contexts when defining a validation.Vince Puzzella2014-01-271-0/+16
| | | | | | Example: validates_presence_of :name, on: [:update, :custom_validation_context]
* Some minor fixesGodfrey Chan2014-01-241-1/+0
|
* Removed old testsGodfrey Chan2014-01-243-250/+121
|
* Rewrote the tests for has_secure_passwordGodfrey Chan2014-01-243-2/+183
|
* Update ActiveModel::Errors.has_key? testAdrien Coquio2014-01-221-1/+1
|
* Add failing test for ActiveModel::Errors#has_key? methodAdrien Coquio2014-01-221-0/+5
| | | | From the doc, this method should return false and not nil if there is no errors for this key
* Fix typoRafael Mendonça França2014-01-211-1/+1
|
* When applying changes or reseting changes create the right classRafael Mendonça França2014-01-201-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. Schuck2014-01-031-33/+33
|
* Merge pull request #13131 from gja/changed-accepts-valuesGodfrey Chan2013-12-301-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 valueTejas Dinkar2013-12-151-0/+10
| | | | | | | | model.name_changed?(from: "Pete", to: "Ringo")
* | Disable locale checks to avoid warnings in Active Model tests [ci skip]Carlos Antonio da Silva2013-12-231-0/+3
| | | | | | | | | | Missed AMo when adding to the other components in ae196e85ee7169700afac2eecdc276bc06b10b8d.
* | Unused classes in AMo testsAkira Matsuda2013-12-191-11/+0
|/
* Merge pull request #13273 from robertomiranda/test-remove-requireGuillermo Iguaran2013-12-111-1/+0
|\ | | | | Remove require 'models/administrator', Administrator is not used in secure password test
| * Remove require 'models/administrator', Administrator is not used in secure ↵robertomiranda2013-12-111-1/+0
| | | | | | | | password test
* | Let validates_inclusion_of accept Time and DateTime rangesAkira Matsuda2013-10-232-1/+23
| | | | | | | | fixes 4.0.0 regression introduced in 0317b93c17a46d7663a8c36edc26ad0ba3d75f85
* | Use bcrypt's public cost attr, not internal constantT.J. Schuck2013-10-101-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/masterRafael Mendonça França2013-10-031-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 attributesWilliam Myers2013-05-271-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-dirtyRafael Mendonça França2013-09-231-2/+1
| | | | | | | | | | | | Make AM::Dirty less dirty to plugin into AR or other library
* | | use assert_empty in activemodel conditional validation test casesRajarshi Das2013-09-101-7/+7
| | |
* | | fix actionview and activemodel test cases typosRajarshi Das2013-09-051-1/+1
| | |
* | | remove unused instance variableRajarshi Das2013-08-231-2/+1
| | |
* | | Dont' check for any order in hash since we aren't sorting it and this is ↵Guillermo Iguaran2013-08-181-11/+0
| | | | | | | | | | | | determinated only by the used interpreter
* | | Refactor serialization test for hash orderGuillermo Iguaran2013-08-181-7/+6
| | |
* | | Avoid Skip in test, have a unified test for orderGaurish Sharma2013-08-091-10/+7
| | |
* | | Add tests for ActiveModel::Serializers::JSON#as_json orderingGaurish Sharma2013-08-091-1/+10
| |/ |/|
* | fix testsMax Shytikov2013-07-301-1/+1
| |
* | Fix secure_password password_confirmation validationsVladimir Kiselev2013-07-241-0/+5
| |
* | Remove redundant escapes from xml serialization testVipul A M2013-07-011-6/+6
| |
* | Remove deprecation warning from AttributeMethodsMatcherPaul Nikitochkin2013-06-281-11/+0
| |
* | Remove deprecated attr_protected/accessibleŁukasz Strzałkowski2013-06-271-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 Silva2013-06-251-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 Bergeron2013-05-271-0/+1
| | | | | | | | | | | | | | | | | | Range#include? for non-numeric ranges added changelog message
* | | ActiveModel::Model inclusion chain backward compatibilityFred Wu2013-06-201-5/+15
| | |
* | | Fixes AciveModel::Model with no ancestors, fixes #11004Fred Wu2013-06-191-2/+23
| | | | | | | | | | | | Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
* | | Fixed ActiveModel::Model's inclusion chainFred Wu2013-06-191-0/+12
| | |
* | | Stub logger for testsAndrey Koleshko2013-06-061-0/+4
| | |
* | | Fix regression in has_secure_password.Phil Calvin2013-05-301-0/+9
|/ / | | | | | | If the confirmation was blank, but the password wasn't, it would still save.
* | deprecate Validator#setup (to get rid of a respond_to call). validators do ↵Nick Sutterer2013-05-232-23/+22
| | | | | | | | their setup in their constructor now.
* | Merge pull request #10527 from zenspider/squishy_minitest5Aaron Patterson2013-05-161-1/+0
|\ \ | | | | | | Squishy minitest5
| * | Updates to make rails 4 happy with minitest 5:Ryan Davis2013-05-061-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + Namespace changes, overhaul of runners. + Internal ivar name changes - Removed a logger globally applied to tests that spew everywhere?!? + Override Minitest#__run to sort tests by name. + Reworked testing isolation to work with the new cleaner architecture. - Removed a bunch of tests that just test minitest straight up. I think these changes were all merged to minitest 4 a long time ago. - Minor report output differences.
* | | callbacks are wrapped with lambdasAaron Patterson2013-05-101-1/+1
|/ /
* | Convert ActiveModel to 1.9 hash syntax.Patrick Robertson2013-05-0125-309/+311
| | | | | | | | | | 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 Silva2013-04-211-2/+2
|\ \ | | | | | | | | | | | | neerajdotname/fix-wrong-test-name-and-failure-message fix wrong test description and failure message