spec/bamboo-client/rest_spec.rb in bamboo-client-0.1.6 vs spec/bamboo-client/rest_spec.rb in bamboo-client-0.1.7
- old
+ new
@@ -1,12 +1,12 @@
require File.expand_path("../../spec_helper", __FILE__)
module Bamboo
module Client
describe Rest do
- let(:http) { mock(Http::Json) }
- let(:document) { mock(Http::Json::Doc) }
+ let(:http) { double(Http::Json) }
+ let(:document) { double(Http::Json::Doc) }
let(:client) { Rest.new(http) }
it "logs in" do
username = 'something'
password = 'somethingelse'
@@ -111,9 +111,15 @@
it "can be queued" do
http.should_receive(:cookies).and_return("some" => "cookie")
http.should_receive(:post).with("/rest/api/latest/queue/S2RB-REMWIN", {}, {"some" => "cookie"})
plan.queue
+ end
+
+ it "can be queued with parameters" do
+ http.should_receive(:cookies).and_return("some" => "cookie")
+ http.should_receive(:post_with_query).with("/rest/api/latest/queue/S2RB-REMWIN", {:customRevision => 'test123'}, {"some" => "cookie"})
+ plan.queue(:customRevision => 'test123')
end
it 'can fetch results' do
document.should_receive(:auto_expand).with(Rest::Result, http)
http.should_receive(:cookies).and_return("some" => "cookie")