spec/support/mock.rb in growthforecast-client-0.80.1 vs spec/support/mock.rb in growthforecast-client-0.80.2

- old
+ new

@@ -223,5 +223,19 @@ to_return(:status => 200, :body => { "error" => 0 }.to_json) end before(:each, &proc) end +shared_context "stub_get_notfound_graph" do + def notfound_graph + { + 'service_name' => 'not found', + 'section_name' => 'not found', + 'graph_name' => 'not found', + } + end + proc = Proc.new do + stub_request(:get, "#{base_uri}/api/#{e notfound_graph['service_name']}/#{e notfound_graph['section_name']}/#{e notfound_graph['graph_name']}"). + to_return(:status => 404, :body => '<html><body><strong>404</strong> Not Found</body></html>') + end + before(:each, &proc) +end