aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorEric Chapweske <eric@chapweske.com>2009-10-18 10:22:22 -0500
committerJoshua Peek <josh@joshpeek.com>2009-10-18 10:22:22 -0500
commit2831996483c6a045f1f38d8030256eb58d9771c3 (patch)
tree39c70042e40fe0fbed98981b5bfdfc542dc023f5 /activerecord/test
parent6873b1d6589c0e8f1c29f156fb1841e165f3a127 (diff)
downloadrails-2831996483c6a045f1f38d8030256eb58d9771c3.tar.gz
rails-2831996483c6a045f1f38d8030256eb58d9771c3.tar.bz2
rails-2831996483c6a045f1f38d8030256eb58d9771c3.zip
Fixed: #without_typecast should only disable typecasting on the duplicated attributes [#3387 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/attributes/typecasting_test.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/activerecord/test/cases/attributes/typecasting_test.rb b/activerecord/test/cases/attributes/typecasting_test.rb
index c712f224b2..8a3b551375 100644
--- a/activerecord/test/cases/attributes/typecasting_test.rb
+++ b/activerecord/test/cases/attributes/typecasting_test.rb
@@ -86,12 +86,14 @@ class TypecastingTest < ActiveRecord::TestCase
end
test "without typecasting" do
+ @attributes.merge!('comments_count' => '5')
attributes = @attributes.without_typecast
- attributes['comments_count'] = '5'
-
+
assert_equal '5', attributes['comments_count']
+ assert_equal 5, @attributes['comments_count'], "Original attributes should typecast"
end
+
test "typecast all attributes" do
attributes = @attributes.merge('title' => 'I love sandwiches', 'comments_count' => '5')
attributes.typecast!