spec/lib/flapjack/web_spec.rb in flapjack-0.6.37 vs spec/lib/flapjack/web_spec.rb in flapjack-0.6.38

- old
+ new

@@ -23,15 +23,13 @@ def expect_stats @redis.should_receive(:keys).with('*').and_return([]) @redis.should_receive(:zcard).with('failed_checks') @redis.should_receive(:keys).with('check:*:*').and_return([]) - @redis.should_receive(:hget).with('event_counters', 'all') - @redis.should_receive(:hget).with('event_counters', 'ok') - @redis.should_receive(:hget).with('event_counters', 'failure') - @redis.should_receive(:hget).with('event_counters', 'action') - @redis.should_receive(:get).with('boot_time').and_return(0) + @redis.should_receive(:zscore).with('executive_instances', anything).and_return(Time.now.to_i) + @redis.should_receive(:hgetall).twice.and_return({'all' => '8001', 'ok' => '8002'}, + {'all' => '9001', 'ok' => '9002'}) # @redis.should_receive(:llen).with('events') end def expect_entity_check_status(ec) time = Time.now.to_i @@ -65,9 +63,10 @@ get '/' last_response.should be_ok end it "shows a page listing failing checks" do + @redis.should_receive(:zrange).with("executive_instances", "0", "-1", :withscores => true) @redis.should_receive(:zrange).with('failed_checks', 0, -1).and_return(["#{entity_name}:#{check}:states"]) expect_stats expect_entity_check_status(entity_check)