README.md in resque_spec-0.4.1 vs README.md in resque_spec-0.4.2
- old
+ new
@@ -118,9 +118,46 @@
person.recalculate
Person.should have_queue_size_of(1)
end
end
+Performing Jobs in Specs
+------------------------
+
+Normally, Resque does not perform queued jobs within tests. You may want to
+make assertions based on the result of your jobs. To process jobs immediately,
+you can pass a block to the `with_resque` helper:
+
+Given this scenario
+
+ Given a game
+ When I score
+ Then the game has a score
+
+I might write this as a Cucumber step
+
+ When /I score/ do
+ with_resque do
+ visit game_path
+ click_link 'Score!'
+ end
+ end
+
+Or I write this spec using the `with_resque` helper
+
+ describe "#score!" do
+ before do
+ ResqueSpec.reset!
+ end
+
+ it "increases the score" do
+ with_resque do
+ game.score!
+ end
+ game.score.should == 10
+ end
+ end
+
Note on Patches/Pull Requests
=============================
* Fork the project.
* Make your feature addition or bug fix.