spec/base_spec.rb in wayfarer-0.4.0 vs spec/base_spec.rb in wayfarer-0.4.1

- old
+ new

@@ -153,10 +153,17 @@ expect { perform_enqueued_jobs }.to change { enqueued_jobs.size }.by(-1) end + it "marks the URL seen" do + task.counter.increment # otherwise barrier gets reset + DummyJob.crawl_later(url, batch: batch) + 3.times { perform_enqueued_jobs } + expect(task.barrier.seen?(task.url)).to be(true) + end + it "decrements the counter" do 3.times { task.counter.increment } DummyJob.crawl_later(url, batch: batch) 3.times { perform_enqueued_jobs } @@ -195,9 +202,16 @@ DummyJob.crawl_later(url, batch: batch) expect { perform_enqueued_jobs }.to change { enqueued_jobs.size }.by(-1) + end + + it "marks the URL seen" do + task.counter.increment # otherwise barrier gets reset + DummyJob.crawl_later(url, batch: batch) + perform_enqueued_jobs + expect(task.barrier.seen?(task.url)).to be(true) end it "decrements the counter" do 3.times { task.counter.increment }