spec/pause/action_spec.rb in pause-0.0.4 vs spec/pause/action_spec.rb in pause-0.0.5
- old
+ new
@@ -58,9 +58,18 @@
action.increment! 1, time
action.ok?.should be_false
end
+
+ it "should return false and silently fail if redis is not available" do
+ Redis.any_instance.stub(:zrange) { raise Redis::CannotConnectError }
+ time = period_marker(resolution, Time.now.to_i)
+
+ action.increment! 4, time - 25
+
+ action.ok?.should be_false
+ end
end
describe "#analyze" do
context "action should not be rate limited" do
it "returns nil" do