spec/lib/flapjack/gateways/api_spec.rb in flapjack-0.7.8 vs spec/lib/flapjack/gateways/api_spec.rb in flapjack-0.7.9
- old
+ new
@@ -89,10 +89,12 @@
with(entity_name, :redis => redis).and_return(entity)
now = Time.now.to_i
entity_check.should_receive(:state).and_return('OK')
+ entity_check.should_receive(:summary).and_return('not bad')
+ entity_check.should_receive(:details).and_return(nil)
entity_check.should_receive(:in_unscheduled_maintenance?).and_return(false)
entity_check.should_receive(:in_scheduled_maintenance?).and_return(false)
entity_check.should_receive(:last_update).and_return(now - 30)
entity_check.should_receive(:last_problem_notification).and_return(now - 60)
entity_check.should_receive(:last_recovery_notification).and_return(now - 30)
@@ -102,10 +104,12 @@
get "/status/#{entity_name_esc}"
last_response.should be_ok
last_response.body.should == [{'name' => check,
'state' => 'OK',
+ 'summary' => 'not bad',
+ 'details' => nil,
'in_unscheduled_maintenance' => false,
'in_scheduled_maintenance' => false,
'last_update' => (now - 30),
'last_problem_notification' => (now - 60),
'last_recovery_notification' => (now - 30),
@@ -127,10 +131,12 @@
with(entity_name, :redis => redis).and_return(entity)
now = Time.now.to_i
entity_check.should_receive(:state).and_return('OK')
+ entity_check.should_receive(:summary).and_return('not bad')
+ entity_check.should_receive(:details).and_return(nil)
entity_check.should_receive(:in_unscheduled_maintenance?).and_return(false)
entity_check.should_receive(:in_scheduled_maintenance?).and_return(false)
entity_check.should_receive(:last_update).and_return(now - 30)
entity_check.should_receive(:last_problem_notification).and_return(now - 60)
entity_check.should_receive(:last_recovery_notification).and_return(now - 30)
@@ -140,9 +146,11 @@
get "/status/#{entity_name_esc}/#{URI.escape(nw_check)}"
last_response.should be_ok
last_response.body.should == {'name' => nw_check,
'state' => 'OK',
+ 'summary' => 'not bad',
+ 'details' => nil,
'in_unscheduled_maintenance' => false,
'in_scheduled_maintenance' => false,
'last_update' => (now - 30),
'last_problem_notification' => (now - 60),
'last_recovery_notification' => (now - 30),