Redistat::Event should store summarized statistics

spec
This commit is contained in:
2010-07-25 21:14:53 +03:00
parent 0d3d5469c0
commit 7cbed7e683

View File

@@ -67,7 +67,17 @@ describe Redistat::Event do
@event.date.to_s.should == fetched.date.to_s
end
it "should store summarized statistics"
it "should store summarized statistics" do
2.times do |i|
@event = Redistat::Event.new(@scope, @label, @date, @stats, @meta, @options).save
Redistat::Date::DEPTHS.each do |depth|
summary = db.hgetall @event.key.to_s(depth)
summary.should have_at_least(1).items
summary["views"].should == (i+1).to_s
break if depth == :hour
end
end
end
def db
Redistat.redis