spec/lib/flapjack/gateways/pagerduty_spec.rb in flapjack-0.7.28 vs spec/lib/flapjack/gateways/pagerduty_spec.rb in flapjack-0.7.29
- old
+ new
@@ -105,11 +105,11 @@
entity_check = double('entity_check')
entity_check.should_receive(:check).and_return('PING')
entity_check.should_receive(:contacts).and_return([contact])
entity_check.should_receive(:entity_name).exactly(2).times.and_return('foo-app-01.bar.net')
Flapjack::Data::Event.should_receive(:create_acknowledgement).with('foo-app-01.bar.net', 'PING',
- :summary => 'Acknowledged on PagerDuty', :redis => redis)
+ :summary => 'Acknowledged on PagerDuty', :duration => 14400, :redis => redis)
Flapjack::Data::Global.should_receive(:unacknowledged_failing_checks).and_return([entity_check])
fp.should_receive(:pagerduty_acknowledged?).and_return({})
@@ -129,20 +129,23 @@
blpop_count = 0
redis.should_receive(:blpop).twice {
blpop_count += 1
if blpop_count == 1
- ["pagerduty_notifications", %q{{"notification_type":"problem","event_id":"main-example.com:ping","state":"critical","summary":"!!!"}}]
+ ["pagerduty_notifications", '{"notification_type":"problem","event_id":"main-example.com:ping",' +
+ '"state":"critical","summary":"!!!","state_duration":120,"duration":30}']
else
fp.instance_variable_set('@should_quit', true)
["pagerduty_notifications", %q{{"notification_type":"shutdown"}}]
end
}
fp.should_receive(:test_pagerduty_connection).and_return(true)
fp.should_receive(:send_pagerduty_event)
fp.start
+
+ @logger.errors.should be_empty
end
it "tests the pagerduty connection" do
evt = { "service_key" => "11111111111111111111111111111111",
"incident_key" => "Flapjack is running a NOOP",