spec/lib/flapjack/data/entity_spec.rb in flapjack-0.7.18 vs spec/lib/flapjack/data/entity_spec.rb in flapjack-0.7.19
- old
+ new
@@ -88,12 +88,12 @@
it "returns a list of checks for an entity" do
Flapjack::Data::Entity.add({'id' => '5000',
'name' => name},
:redis => @redis)
- @redis.hset("check:#{name}:ping", 'state', 'OK')
- @redis.hset("check:#{name}:ssh", 'state', 'OK')
+ @redis.zadd("current_checks:#{name}", Time.now.to_i, "ping")
+ @redis.zadd("current_checks:#{name}", Time.now.to_i, "ssh")
entity = Flapjack::Data::Entity.find_by_name(name, :redis => @redis)
check_list = entity.check_list
check_list.should_not be_nil
check_list.should have(2).checks
@@ -106,11 +106,11 @@
Flapjack::Data::Entity.add({'id' => '5000',
'name' => name,
'contacts' => []},
:redis => @redis)
- @redis.hset("check:#{name}:ping", 'state', 'OK')
- @redis.hset("check:#{name}:ssh", 'state', 'OK')
+ @redis.zadd("current_checks:#{name}", Time.now.to_i, "ping")
+ @redis.zadd("current_checks:#{name}", Time.now.to_i, "ssh")
entity = Flapjack::Data::Entity.find_by_id(5000, :redis => @redis)
check_count = entity.check_count
check_count.should_not be_nil
check_count.should == 2