diff options
author | Rick Olson <technoweenie@gmail.com> | 2007-06-01 17:14:14 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2007-06-01 17:14:14 +0000 |
commit | 4d1c87a069d0e13347f28ff9ce4db2427efe18b1 (patch) | |
tree | f62371534776b2cb8b531deae115027b83dc5961 /activeresource/test | |
parent | 846e8587273743b5cc46708b3c0f047bb501fe02 (diff) | |
download | rails-4d1c87a069d0e13347f28ff9ce4db2427efe18b1.tar.gz rails-4d1c87a069d0e13347f28ff9ce4db2427efe18b1.tar.bz2 rails-4d1c87a069d0e13347f28ff9ce4db2427efe18b1.zip |
pass the prefix_options to the instantiated record when using find without a specific id. Closes #8544 [alloy]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6925 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activeresource/test')
-rw-r--r-- | activeresource/test/base_test.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/activeresource/test/base_test.rb b/activeresource/test/base_test.rb index db02cc2716..bf73732c8f 100644 --- a/activeresource/test/base_test.rb +++ b/activeresource/test/base_test.rb @@ -313,7 +313,7 @@ class BaseTest < Test::Unit::TestCase assert_equal true, matz.save end - def test_update_with_custom_prefix + def test_update_with_custom_prefix_with_specific_id addy = StreetAddress.find(1, :params => { :person_id => 1 }) addy.street = "54321 Street" assert_kind_of StreetAddress, addy @@ -321,6 +321,14 @@ class BaseTest < Test::Unit::TestCase addy.save end + def test_update_with_custom_prefix_without_specific_id + addy = StreetAddress.find(:first, :params => { :person_id => 1 }) + addy.street = "54321 Lane" + assert_kind_of StreetAddress, addy + assert_equal "54321 Lane", addy.street + addy.save + end + def test_update_conflict ActiveResource::HttpMock.respond_to do |mock| mock.get "/people/2.xml", {}, @david |