diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2007-04-26 19:38:16 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2007-04-26 19:38:16 +0000 |
commit | 234b0b7ca021cff6e36376c38b7c70321b8550f1 (patch) | |
tree | 19286d784104a3071e532978b1238345f8cf37c0 /activeresource/test/base | |
parent | 37e8e35c92222537ff82aa3c47cadebad4c32ce0 (diff) | |
download | rails-234b0b7ca021cff6e36376c38b7c70321b8550f1.tar.gz rails-234b0b7ca021cff6e36376c38b7c70321b8550f1.tar.bz2 rails-234b0b7ca021cff6e36376c38b7c70321b8550f1.zip |
Added support for using classes from within a single nested module [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6587 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activeresource/test/base')
-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 |