spec/gush/job_spec.rb in gush-2.0.0 vs spec/gush/job_spec.rb in gush-2.0.1
- old
+ new
@@ -50,13 +50,21 @@
end
describe "#start!" do
it "resets flags and marks as running" do
job = described_class.new(name: "a-job")
+
+ job.enqueue!
+ job.fail!
+
+ now = Time.now.to_i
+ expect(job.started_at).to eq(nil)
+ expect(job.failed_at).to eq(now)
+
job.start!
+
expect(job.started_at).to eq(Time.now.to_i)
- expect(job.enqueued?).to eq(false)
- expect(job.running?).to eq(true)
+ expect(job.failed_at).to eq(nil)
end
end
describe "#as_json" do
context "finished and enqueued set to true" do