tests/dynect/requests/dns/dns_tests.rb in fog-1.11.1 vs tests/dynect/requests/dns/dns_tests.rb in fog-1.12.0
- old
+ new
@@ -173,35 +173,35 @@
pending unless Fog.mocking?
old_mock_value = Excon.defaults[:mock]
Excon.stubs.clear
- tests("returns final response from a complete job") do
+ tests("returns final response from a complete job").returns({"status" => "success"}) do
begin
Excon.defaults[:mock] = true
Excon.stub({:method => :post, :path => "/REST/Session"}, {:body=>"{\"status\": \"success\", \"data\": {\"token\": \"foobar\", \"version\": \"2.3.1\"}, \"job_id\": 150583906, \"msgs\": [{\"INFO\": \"login: Login successful\", \"SOURCE\": \"BLL\", \"ERR_CD\": null, \"LVL\": \"INFO\"}]}", :headers=>{"Content-Type"=>"application/json"}, :status=>200})
Excon.stub({:method => :get, :path => "/REST/Zone/example.com"}, {:status => 307, :body => '/REST/Job/150576635', :headers => {'Content-Type' => 'text/html', 'Location' => '/REST/Job/150576635'}})
Excon.stub({:method => :get, :path => "/REST/Job/150576635"}, {:status => 307, :body => '{"status":"success"}', :headers => {'Content-Type' => 'application/json'}})
- Fog::DNS::Dynect::Real.new.request(:method => :get, :path => "Zone/example.com").body.should == { "status" => "success" }
+ Fog::DNS::Dynect::Real.new.request(:method => :get, :path => "Zone/example.com").body
ensure
Excon.stubs.clear
Excon.defaults[:mock] = old_mock_value
end
end
- tests("passes expects through when polling a job") do
+ tests("passes expects through when polling a job").returns({"status" => "success"}) do
begin
Excon.defaults[:mock] = true
Excon.stub({:method => :post, :path => "/REST/Session"}, {:body=>"{\"status\": \"success\", \"data\": {\"token\": \"foobar\", \"version\": \"2.3.1\"}, \"job_id\": 150583906, \"msgs\": [{\"INFO\": \"login: Login successful\", \"SOURCE\": \"BLL\", \"ERR_CD\": null, \"LVL\": \"INFO\"}]}", :headers=>{"Content-Type"=>"application/json"}, :status=>200})
Excon.stub({:method => :get, :path => "/REST/Zone/example.com"}, {:status => 307, :body => '/REST/Job/150576635', :headers => {'Content-Type' => 'text/html', 'Location' => '/REST/Job/150576635'}})
Excon.stub({:method => :get, :path => "/REST/Job/150576635"}, {:status => 404, :body => '{"status":"success"}', :headers => {'Content-Type' => 'application/json'}})
- Fog::DNS::Dynect::Real.new.request(:method => :get, :expects => 404, :path => "Zone/example.com").body.should == { "status" => "success" }
+ Fog::DNS::Dynect::Real.new.request(:method => :get, :expects => 404, :path => "Zone/example.com").body
ensure
Excon.stubs.clear
Excon.defaults[:mock] = old_mock_value
end
end