aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/test/abstract_unit.rb
diff options
context:
space:
mode:
authorMatthijs Langenberg <mlangenberg@gmail.com>2010-09-24 22:37:26 +0200
committerJosé Valim <jose.valim@gmail.com>2010-09-27 23:10:55 +0200
commit67a838574be000f329c0f340474bc9cec1aeca16 (patch)
treeea3c23a7a5b4df852e5fa041da1c03fc6f42576c /activeresource/test/abstract_unit.rb
parentdd83140b24dcb8a27e226c9de286318a44d7fab1 (diff)
downloadrails-67a838574be000f329c0f340474bc9cec1aeca16.tar.gz
rails-67a838574be000f329c0f340474bc9cec1aeca16.tar.bz2
rails-67a838574be000f329c0f340474bc9cec1aeca16.zip
Fix broken module namespacing in ActiveResource with Ruby 1.9 [#5699 state:resolved]
Following namespace use case was broken with Ruby 1.9: class Author < ActiveRecord::Base ... end module Api class Book < ActiveResouce::Base end end Let's say XML contains <book><author><name>John</name></author>.... Api::Book.first.author.class.to_s #=> Ruby 1.8.7: "Api::Book::Author" (namespaced, correct), Ruby 1.9: "Author" (toplevel, broken) Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activeresource/test/abstract_unit.rb')
-rw-r--r--activeresource/test/abstract_unit.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activeresource/test/abstract_unit.rb b/activeresource/test/abstract_unit.rb
index 544aede002..195f93f2a6 100644
--- a/activeresource/test/abstract_unit.rb
+++ b/activeresource/test/abstract_unit.rb
@@ -75,6 +75,10 @@ def setup_response
</person>
eof
+ @startup_sound = {
+ :name => "Mac Startup Sound", :author => { :name => "Jim Reekes" }
+ }.to_xml(:root => 'sound')
+
ActiveResource::HttpMock.respond_to do |mock|
mock.get "/people/1.xml", {}, @matz
mock.get "/people/2.xml", {}, @david
@@ -112,6 +116,8 @@ def setup_response
mock.head "/people/Greg/addresses/1.xml", {}, nil, 200
# customer
mock.get "/customers/1.xml", {}, @luis
+ # sound
+ mock.get "/sounds/1.xml", {}, @startup_sound
end
Person.user = nil