aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/test
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-01-24 18:27:36 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-01-24 18:27:36 +0000
commit1b1ddf17367f902dfbacf9143f0c90b7c42436dc (patch)
treee37757a3671f4a835825597660b144e912979f34 /activeresource/test
parent873f5e2f3ca1be0d260b44e0f09aa59aa824a1b9 (diff)
downloadrails-1b1ddf17367f902dfbacf9143f0c90b7c42436dc.tar.gz
rails-1b1ddf17367f902dfbacf9143f0c90b7c42436dc.tar.bz2
rails-1b1ddf17367f902dfbacf9143f0c90b7c42436dc.zip
Loading a resource preserves its prefix_options. Closes #7353. Silence prefix redefinition warnings; fix type in logged error.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6032 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activeresource/test')
-rw-r--r--activeresource/test/base_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activeresource/test/base_test.rb b/activeresource/test/base_test.rb
index 4d3bb7461e..15e9609034 100644
--- a/activeresource/test/base_test.rb
+++ b/activeresource/test/base_test.rb
@@ -217,6 +217,13 @@ class BaseTest < Test::Unit::TestCase
assert_equal '5', matzs_house.id
end
+ # Test that loading a resource preserves its prefix_options.
+ def test_load_preserves_prefix_options
+ address = StreetAddress.find(1, :person_id => 1)
+ ryan = Person.new(:id => 1, :name => 'Ryan', :address => address)
+ assert_equal address.prefix_options, ryan.address.prefix_options
+ end
+
def test_create
rick = Person.create(:name => 'Rick')
assert rick.valid?