1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activemodel/test/cases
Yves Senn 7d196cf360 #to_param returns nil if to_key returns nil. Closes #11399.
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>'
```
2014-02-04 10:27:46 +01:00
..
serializers fix actionview and activemodel test cases typos 2013-09-05 14:21:57 +05:30
validations use the new clear_validators! api everywhere to reset validators in tests 2014-01-28 00:13:35 +05:30
attribute_methods_test.rb Remove deprecation warning from AttributeMethodsMatcher 2013-06-28 00:16:42 +03:00
callbacks_test.rb Convert ActiveModel to 1.9 hash syntax. 2013-05-01 18:01:46 -07:00
conversion_test.rb #to_param returns nil if to_key returns nil. Closes #11399. 2014-02-04 10:27:46 +01:00
dirty_test.rb Fix typo 2014-01-21 22:38:07 -02:00
errors_test.rb Update ActiveModel::Errors.has_key? test 2014-01-22 21:26:53 +01:00
forbidden_attributes_protection_test.rb Don't use assert_nothing_raised when assert_equal is used 2012-09-16 23:58:21 -05:00
helper.rb Disable locale checks to avoid warnings in Active Model tests [ci skip] 2013-12-23 17:51:07 -02:00
lint_test.rb Trim down Active Model API by removing valid? and errors.full_messages 2012-02-07 23:10:43 +01:00
model_test.rb ActiveModel::Model inclusion chain backward compatibility 2013-06-20 12:16:17 +10:00
naming_test.rb Small typos here and there. 2013-03-15 11:55:03 +05:30
railtie_test.rb fix tests 2013-07-30 20:03:57 +03:00
secure_password_test.rb Some minor fixes 2014-01-24 20:06:31 -08:00
serialization_test.rb Convert ActiveModel to 1.9 hash syntax. 2013-05-01 18:01:46 -07:00
translation_test.rb Convert ActiveModel to 1.9 hash syntax. 2013-05-01 18:01:46 -07:00
validations_test.rb Use the new clear_validators! api to reset validators in tests 2014-01-27 08:26:54 -02:00