aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/test
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-01-02 09:14:34 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2008-01-02 09:14:34 +0000
commit9a97f9a14bb7cce56bceccca8755d42598be2290 (patch)
tree45529a4adac2fabfbe6f43c47ec11ed39ada57d3 /activeresource/test
parent4e04ec4adb4bae4e880a73a6f9ce1851d444b058 (diff)
downloadrails-9a97f9a14bb7cce56bceccca8755d42598be2290.tar.gz
rails-9a97f9a14bb7cce56bceccca8755d42598be2290.tar.bz2
rails-9a97f9a14bb7cce56bceccca8755d42598be2290.zip
find_or_create_resource_for handles module nesting. Closes #10646.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8525 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activeresource/test')
-rw-r--r--activeresource/test/base/load_test.rb35
1 files changed, 35 insertions, 0 deletions
diff --git a/activeresource/test/base/load_test.rb b/activeresource/test/base/load_test.rb
index 622afb2fdf..944f337aed 100644
--- a/activeresource/test/base/load_test.rb
+++ b/activeresource/test/base/load_test.rb
@@ -10,6 +10,29 @@ module Highrise
class Comment < ActiveResource::Base
self.site = "http://37s.sunrise.i:3000"
end
+
+ module Deeply
+ module Nested
+
+ class Note < ActiveResource::Base
+ self.site = "http://37s.sunrise.i:3000"
+ end
+
+ class Comment < ActiveResource::Base
+ self.site = "http://37s.sunrise.i:3000"
+ end
+
+ module TestDifferentLevels
+
+ class Note < ActiveResource::Base
+ self.site = "http://37s.sunrise.i:3000"
+ end
+
+ end
+
+ end
+ end
+
end
@@ -108,4 +131,16 @@ class BaseLoadTest < Test::Unit::TestCase
n = Highrise::Note.new(:comments => [{ :name => "1" }])
assert_kind_of Highrise::Comment, n.comments.first
end
+
+ def test_nested_collections_within_deeply_nested_namespace
+ n = Highrise::Deeply::Nested::Note.new(:comments => [{ :name => "1" }])
+ assert_kind_of Highrise::Deeply::Nested::Comment, n.comments.first
+ end
+
+ def test_nested_collections_in_different_levels_of_namespaces
+ n = Highrise::Deeply::Nested::TestDifferentLevels::Note.new(:comments => [{ :name => "1" }])
+ assert_kind_of Highrise::Deeply::Nested::Comment, n.comments.first
+ end
+
+
end