From b8393c1d6865e87dead8a1c6468586bcabaa3e92 Mon Sep 17 00:00:00 2001 From: Ben Schwarz Date: Sun, 31 Jan 2010 18:08:24 +1100 Subject: [PATCH] Catch requests at a higher level --- spec/throne/document_spec.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/throne/document_spec.rb b/spec/throne/document_spec.rb index ccfed9e..70f8131 100644 --- a/spec/throne/document_spec.rb +++ b/spec/throne/document_spec.rb @@ -53,8 +53,9 @@ class TestDocumentWithDefault < Throne::Document end it "should get a document with params" do - RestClient.should_receive(:get).with(/descending=true/, {:accept_encoding=>"gzip, deflate"}) - TestDocument.get("fake-id", {:descending => true}) + doc = TestDocument.create + Throne::Request.should_receive(:get).with({:params=>{:descending=>true}, :resource=>doc._id, :database=>:document_specs}) + TestDocument.get(doc._id, {:descending => true}) end it "should get a specific revision" do