test/worker_test.rb in resque-mongo-1.3.1 vs test/worker_test.rb in resque-mongo-1.4.0
- old
+ new
@@ -112,10 +112,18 @@
end
assert_equal [], Resque.workers
end
+ test "removes worker with stringified id" do
+ @worker.work(0) do
+ worker_id = Resque.workers[0].to_s
+ Resque.remove_worker(worker_id)
+ assert_equal [], Resque.workers
+ end
+ end
+
test "records what it is working on" do
@worker.work(0) do
task = @worker.job
assert_equal({"args"=>[20, "/tmp"], "class"=>"SomeJob"}, task['payload'])
assert task['run_at']
@@ -223,7 +231,12 @@
# then we prune them
@worker.work(0) do
assert_equal 1, Resque.workers.size
end
+ end
+
+ test "Processed jobs count" do
+ @worker.work(0)
+ assert_equal 1, Resque.info[:processed]
end
end