From 1fc1986d6deacd71ec4bea2287d9cfed6123b898 Mon Sep 17 00:00:00 2001 From: Jatinder Singh Date: Sun, 9 Aug 2009 22:24:50 +0100 Subject: Make ActiveResource#exists? work [#3020 state:resolved] Signed-off-by: Pratik Naik --- activeresource/test/base_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'activeresource/test') diff --git a/activeresource/test/base_test.rb b/activeresource/test/base_test.rb index 2e1236cab4..cba675177a 100644 --- a/activeresource/test/base_test.rb +++ b/activeresource/test/base_test.rb @@ -966,6 +966,14 @@ class BaseTest < Test::Unit::TestCase end end + def test_exists_without_http_mock + http = Net::HTTP.new(Person.site.host, Person.site.port) + ActiveResource::Connection.any_instance.expects(:http).returns(http) + http.expects(:request).returns(ActiveResource::Response.new("")) + + assert Person.exists?('not-mocked') + end + def test_to_xml matz = Person.find(1) xml = matz.encode -- cgit v1.2.3