aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/test
diff options
context:
space:
mode:
authorJosef Reidinger <jreidinger@suse.cz>2010-07-27 09:55:33 +0200
committerJosé Valim <jose.valim@gmail.com>2010-08-02 17:06:09 +0200
commit59693c4c49cce5e4cf53eb54e42e3da07a98467e (patch)
tree0835960f47466fbc3b7b88fa16ddbf81b4ba8542 /activeresource/test
parente1344bf5048934b0f231974c3597dfbc1c76154f (diff)
downloadrails-59693c4c49cce5e4cf53eb54e42e3da07a98467e.tar.gz
rails-59693c4c49cce5e4cf53eb54e42e3da07a98467e.tar.bz2
rails-59693c4c49cce5e4cf53eb54e42e3da07a98467e.zip
fix loading of different elements in array then int and string [#5036 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activeresource/test')
-rw-r--r--activeresource/test/cases/base/load_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/activeresource/test/cases/base/load_test.rb b/activeresource/test/cases/base/load_test.rb
index 7745a9439b..228dc36d9b 100644
--- a/activeresource/test/cases/base/load_test.rb
+++ b/activeresource/test/cases/base/load_test.rb
@@ -47,6 +47,8 @@ class BaseLoadTest < Test::Unit::TestCase
{ :id => 1, :name => 'Willamette' },
{ :id => 2, :name => 'Columbia', :rafted_by => @matz }],
:postal_codes => [ 97018, 1234567890 ],
+ :dates => [ Time.now ],
+ :votes => [ true, false, true ],
:places => [ "Columbia City", "Unknown" ]}}}
@person = Person.new
@@ -149,6 +151,16 @@ class BaseLoadTest < Test::Unit::TestCase
assert_kind_of Array, places
assert_kind_of String, places.first
assert_equal @deep[:street][:state][:places].first, places.first
+
+ dates = state.dates
+ assert_kind_of Array, dates
+ assert_kind_of Time, dates.first
+ assert_equal @deep[:street][:state][:dates].first, dates.first
+
+ votes = state.votes
+ assert_kind_of Array, votes
+ assert_kind_of TrueClass, votes.first
+ assert_equal @deep[:street][:state][:votes].first, votes.first
end
def test_nested_collections_within_the_same_namespace