diff --git a/README.md b/README.md index 6b778d6..db6c9ad 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,20 @@ describe "#recalculate" do end ``` +You can validate the number of times that a job was scheduled + +```ruby +describe "#recalculate" do + it "adds person.calculate to the Person queue" do + person.recalculate + expect(Person).to have_queued(person.id, :calculate).once + # or + expect(Person).to have_queued(person.id, :calculate).times(1) + end +end +``` + + Turning off ResqueSpec and calling directly to Resque ----------------------------------------------------- @@ -206,6 +220,8 @@ describe "#welcome_email" do end ``` + + resque-scheduler with Specs ==========================