spec/lib/flapjack/gateways/pagerduty_spec.rb in flapjack-1.1.0 vs spec/lib/flapjack/gateways/pagerduty_spec.rb in flapjack-1.2.0rc1

- old
+ new

@@ -149,11 +149,11 @@ it "tests the pagerduty connection" do evt = { "service_key" => "11111111111111111111111111111111", "incident_key" => "Flapjack is running a NOOP", "event_type" => "nop", - "description" => "I love APIs with noops." } + "description" => "I love APIs with noops."} body = evt.to_json stub_request(:post, "https://events.pagerduty.com/generic/2010-04-15/create_event.json"). with(:body => body).to_return(:status => 200, :body => '{"status":"success"}', :headers => {}) @@ -167,12 +167,14 @@ end end it "sends an event to pagerduty" do evt = {"service_key" => "abcdefg", - "incident_key" => "Flapjack test", + "incident_key" => "www.example.com:ssh", "event_type" => "nop", - "description" => "Not really sent anyway"} + "description" => "Not really sent anyway", + "details" => { 'HOSTNAME' => 'www.example.com', 'SERVICE' => 'ssh' } + } body = evt.to_json stub_request(:post, "https://events.pagerduty.com/generic/2010-04-15/create_event.json"). with(:body => body).to_return(:status => 200, :body => "", :headers => {})