Add Job#load to load info from DB

This commit is contained in:
Dzmitry Plashchynski
2015-03-06 23:44:30 +02:00
parent c54f52a71d
commit 78b1d8d6e1
2 changed files with 17 additions and 0 deletions

View File

@@ -40,4 +40,17 @@ describe Crono::Job do
expect(@crono_job.last_performed_at).to be_eql(job.last_performed_at)
end
end
describe "#load" do
before do
@saved_last_performed_at = job.last_performed_at = Time.now
job.save
end
it "should load info from DB" do
@job = Crono::Job.new(TestJob, period)
@job.load
expect(@job.last_performed_at).to be_eql @saved_last_performed_at
end
end
end