aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/test/base_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activeresource/test/base_test.rb')
-rw-r--r--activeresource/test/base_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/activeresource/test/base_test.rb b/activeresource/test/base_test.rb
index 51e1dd3c04..2c823e8e69 100644
--- a/activeresource/test/base_test.rb
+++ b/activeresource/test/base_test.rb
@@ -13,6 +13,7 @@ class BaseTest < Test::Unit::TestCase
ActiveResource::HttpMock.respond_to do |mock|
mock.get "/people/1.xml", {}, @matz
mock.get "/people/2.xml", {}, @david
+ mock.get "/people/3.xml", {'key' => 'value'}, nil, 404
mock.put "/people/1.xml", {}, nil, 204
mock.delete "/people/1.xml", {}, nil, 200
mock.delete "/people/2.xml", {}, nil, 400
@@ -198,6 +199,13 @@ class BaseTest < Test::Unit::TestCase
assert_equal "Matz", matz.name
end
+ def test_custom_header
+ Person.custom_headers['key'] = 'value'
+ assert_raises(ActiveResource::ResourceNotFound) { Person.find(3) }
+ ensure
+ Person.custom_headers.delete('key')
+ end
+
def test_find_by_id_not_found
assert_raises(ActiveResource::ResourceNotFound) { Person.find(99) }
assert_raises(ActiveResource::ResourceNotFound) { StreetAddress.find(1) }