diff options
Diffstat (limited to 'activeresource/test')
-rw-r--r-- | activeresource/test/base/load_test.rb | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/activeresource/test/base/load_test.rb b/activeresource/test/base/load_test.rb index 6d2f65e1c5..28f1cfc97c 100644 --- a/activeresource/test/base/load_test.rb +++ b/activeresource/test/base/load_test.rb @@ -2,6 +2,17 @@ require "#{File.dirname(__FILE__)}/../abstract_unit" require "fixtures/person" require "fixtures/street_address" +module Highrise + class Note < ActiveResource::Base + self.site = "http://37s.sunrise.i:3000" + end + + class Comment < ActiveResource::Base + self.site = "http://37s.sunrise.i:3000" + end +end + + class BaseLoadTest < Test::Unit::TestCase def setup @matz = { :id => 1, :name => 'Matz' } @@ -92,4 +103,9 @@ class BaseLoadTest < Test::Unit::TestCase assert_equal @deep[:street][:state][:notable_rivers].first[:id], rivers.first.id assert_equal @matz[:id], rivers.last.rafted_by.id end -end + + def test_nested_collections_within_the_same_namespace + n = Highrise::Note.new(:comments => [{ :name => "1" }]) + assert_kind_of Highrise::Comment, n.comments.first + end +end
\ No newline at end of file |