spec/lib/sidekiq-status/worker_spec.rb in sidekiq-status-3.0.0 vs spec/lib/sidekiq-status/worker_spec.rb in sidekiq-status-3.0.1

- old
+ new

@@ -18,6 +18,24 @@ expect(subject.expiration).to be_nil subject.expiration = :val expect(subject.expiration).to eq(:val) end end + + describe ".at" do + subject { StubJob.new } + + it "records when the worker has started" do + expect { subject.at(0) }.to(change { subject.retrieve('working_at') }) + end + + context "when setting the total for the worker" do + it "records when the worker has started" do + expect { subject.total(100) }.to(change { subject.retrieve('working_at') }) + end + end + + it "records when the worker last worked" do + expect { subject.at(0) }.to(change { subject.retrieve('update_time') }) + end + end end