summaryrefslogtreecommitdiffstats
path: root/spec/unit/network/http/handler.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-07-29 19:11:58 -0500
committerLuke Kanies <luke@madstop.com>2008-07-29 19:11:58 -0500
commit43a6911f656178efb5c2236c8b890127ab0880d3 (patch)
treebef79d0f47cec0b3e208399d43e7f3a7a357a410 /spec/unit/network/http/handler.rb
parent1064b5bdcd207efc20ae4ed0fd509364402964f9 (diff)
downloadpuppet-43a6911f656178efb5c2236c8b890127ab0880d3.tar.gz
puppet-43a6911f656178efb5c2236c8b890127ab0880d3.tar.xz
puppet-43a6911f656178efb5c2236c8b890127ab0880d3.zip
Searching again works over REST, including full content-type translation.
The format management is a bit clunky right now, though, so I need to fix how they're managed. Some of these tests fail, but 99% of the remaining work is in other classes so I wanted this as a discrete commit. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec/unit/network/http/handler.rb')
-rwxr-xr-xspec/unit/network/http/handler.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/spec/unit/network/http/handler.rb b/spec/unit/network/http/handler.rb
index 0f60b9b10..1ed816d97 100755
--- a/spec/unit/network/http/handler.rb
+++ b/spec/unit/network/http/handler.rb
@@ -296,6 +296,7 @@ describe Puppet::Network::HTTP::Handler do
@result2 = mock 'results'
@result = [@result1, @result2]
+ @model_class.stubs(:render_multiple).returns "my rendered instances"
@model_class.stubs(:search).returns(@result)
end
@@ -320,11 +321,13 @@ describe Puppet::Network::HTTP::Handler do
end
it "should return a list of serialized objects when a model search call succeeds" do
- pending "I have not figured out how to do this yet"
- @result1.expects(:render).returns "result1"
- @result2.expects(:render).returns "result2"
+ @handler.expects(:accept_header).with(@request).returns "one,two"
@model_class.stubs(:search).returns(@result)
+
+ @model_class.expects(:render_multiple).with("one", @result).returns "my rendered instances"
+
+ @handler.expects(:set_response).with { |response, data| data == "my rendered instances" }
@handler.do_search(@request, @response)
end
end