From 1b1ddf17367f902dfbacf9143f0c90b7c42436dc Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Wed, 24 Jan 2007 18:27:36 +0000 Subject: 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 --- activeresource/test/base_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'activeresource/test') 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? -- cgit v1.2.3