spec/lib/flapjack/gateways/pagerduty_spec.rb in flapjack-0.6.51 vs spec/lib/flapjack/gateways/pagerduty_spec.rb in flapjack-0.6.52

- old
+ new

@@ -91,17 +91,20 @@ it "creates acknowledgements when pagerduty acknowledgements are found" do fp = Flapjack::Gateways::Pagerduty.new Flapjack::RedisPool.should_receive(:new) fp.bootstrap(:config => config) - entity_check = mock('entity_check') - entity_check.should_receive(:check).and_return('PING') - entity_check.should_receive(:pagerduty_credentials).and_return([{ + contact = mock('contact') + contact.should_receive(:pagerduty_credentials).and_return({ 'service_key' => '12345678', 'subdomain"' => 'flpjck', 'username' => 'flapjack', 'password' => 'password123' - }]) + }) + + entity_check = mock('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:PING') entity_check.should_receive(:create_acknowledgement).with('summary' => 'Acknowledged on PagerDuty') Flapjack::Data::Global.should_receive(:unacknowledged_failing_checks).and_return([entity_check])