|
|
@@ -33,6 +33,12 @@ describe Agents::PublicTransportAgent do
|
33
|
33
|
lambda { @agent.check }.should change {@agent.events.count}.by(4)
|
34
|
34
|
lambda { @agent.check }.should_not change {@agent.events.count}
|
35
|
35
|
end
|
|
36
|
+ it "should reset memory after 2 hours" do
|
|
37
|
+ lambda { @agent.check }.should change {@agent.events.count}.by(4)
|
|
38
|
+ stub(Time).now {"2014-01-14 20:21:30 +0500".to_time + 3.hours}
|
|
39
|
+ @agent.cleanup_old_memory
|
|
40
|
+ lambda { @agent.check }.should change {@agent.events.count}.by(4)
|
|
41
|
+ end
|
36
|
42
|
end
|
37
|
43
|
describe "validation" do
|
38
|
44
|
it "should validate presence of stops" do
|