aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/test/base_test.rb
diff options
context:
space:
mode:
authorJatinder Singh <jatinder.saundh@gmail.com>2009-08-09 22:24:50 +0100
committerPratik Naik <pratiknaik@gmail.com>2009-08-09 22:24:57 +0100
commit1fc1986d6deacd71ec4bea2287d9cfed6123b898 (patch)
tree619342aaca4a0837048c54e9d420f6bf2f7cc672 /activeresource/test/base_test.rb
parent0ec64bea9293dd21588359da80bb43b82886cf2c (diff)
downloadrails-1fc1986d6deacd71ec4bea2287d9cfed6123b898.tar.gz
rails-1fc1986d6deacd71ec4bea2287d9cfed6123b898.tar.bz2
rails-1fc1986d6deacd71ec4bea2287d9cfed6123b898.zip
Make ActiveResource#exists? work [#3020 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
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 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