README.md in resque_spec-0.13.0 vs README.md in resque_spec-0.14.0

- old
+ new

@@ -24,13 +24,13 @@ Cucumber -------- By default, the above will add the `ResqueSpec` module and make it available in Cucumber. If you want the `with_resque` and `without_resque` helpers, manually -require the `resque\_spec/cucumber` module: +require the `resque_spec/cucumber` module: - require 'resque\_spec/cucumber' + require 'resque_spec/cucumber' This can be done in `features/support/env.rb` or in a specific support file such as `features/support/resque.rb`. What is ResqueSpec? @@ -64,12 +64,15 @@ person.recalculate Person.should have_queued(person.id, :calculate) end end -(And I take note of the `before` block that is calling `reset!` for every spec) +And I see that the `have_queued` assertion is asserting that the `Person` queue has a job with arguments `person.id` and `:calculate` + +And I take note of the `before` block that is calling `reset!` for every spec + And I might use the `in` statement to specify the queue: describe "#recalculate" do before do ResqueSpec.reset! @@ -144,10 +147,32 @@ environment. Your initializer will probably end up looking like: # config/initializers/resque_mailer.rb Resque::Mailer.excluded_environments = [] +If you have a mailer like this: + + class ExampleMailer < ActionMailer::Base + include Resque::Mailer + + def welcome_email(user_id) + end + end + +You can write a spec like this: + + describe "#welcome_email" do + before do + ResqueSpec.reset! + Examplemailer.welcome_email(user.id).deliver + end + + subject { described_class } + it { should have_queue_size_of(1) } + it { should have_queued(:welcome_email, user.id) } + end + resque-scheduler with Specs ========================== To use with resque-scheduler, add this require `require 'resque_spec/scheduler'` @@ -356,33 +381,36 @@ [Twitter](https://twitter.com/leshill). Contributors ============ -* @kennethkalmer (Kenneth Kalmer) :rspec dependency fix -* @bcardarella (Brian Cardarella) :fix mutation bug -* @joshdavey (Joshua Davey) :with\_resque helper -* @supaspoida (Lar Van Der Jagt) :with\_resque helper -* @evansagge (Evan Sagge) :Hook in via Job.create, have\_queued.in -* @l4rk (Jon Larkowski) :inline perform -* @jcf (James Conroy-Finn) :spec fix -* @ess (Dennis Walters) :enqueue\_in support -* @RipTheJacker :remove\_delayed support -* @kwerle (Kurt Werle) :explicit require spec for v020 -* @dwilkie :initial before\_enqueue support -* @marcinb (Marcin Balinski) :have\_schedule\_size\_of matcher, schedule matcher at, in -* @alexeits :fix matcher in bug with RSpec 2.8.0 -* @ToadJamb :encode/decode of Resque job arguments -* @mkonikowski (Mateusz Konikowski) :support for anything matcher -* @mathieuravaux (Mathieu Ravaux) :without\_resque\_spec support -* @avdgaag (Arjan van der Gaag) :peek support -* @dtsiknis :Updated removed\_delayed -* @lellisga (Li Ellis Gallardo) :fix inline/disable\_ext bug -* @jeffdeville (Jeff Deville) :Resque.size -* @opinel (Frank Wambutt) :Fix DST problem in `have\_scheduled` -* @lukemelia (Luke Melia) :Add `times` chained matcher -* @heelhook (Pablo Fernandez) :Add `have_queue_size_of_at_least` and `have_schedule_size_of_at_least` matchers -* @k1w1 :Add support for enqueue_at_with_queue/enqueue_in_with_queue +* Kenneth Kalmer (@kennethkalmer) : rspec dependency fix +* Brian Cardarella (@bcardarella) : fix mutation bug +* Joshua Davey (@joshdavey) : with\_resque helper +* Lar Van Der Jagt (@supaspoida) : with\_resque helper +* Evan Sagge (@evansagge) : Hook in via Job.create, have\_queued.in +* Jon Larkowski (@l4rk) : inline perform +* James Conroy-Finn (@jcf) : spec fix +* Dennis Walters (@ess) : enqueue\_in support +* (@RipTheJacker) : remove\_delayed support +* Kurt Werle (@kwerle) : explicit require spec for v020 +* (@dwilkie) : initial before\_enqueue support +* Marcin Balinski (@marcinb) : have\_schedule\_size\_of matcher, schedule matcher at, in +* (@alexeits) : fix matcher in bug with RSpec 2.8.0 +* (@ToadJamb) : encode/decode of Resque job arguments +* Mateusz Konikowski (@mkonikowski) : support for anything matcher +* Mathieu Ravaux (@mathieuravaux) : without\_resque\_spec support +* Arjan van der Gaag (@avdgaag) : peek support +* (@dtsiknis) : Updated removed\_delayed +* Li Ellis Gallardo (@lellisga) : fix inline/disable\_ext bug +* Jeff Deville (@jeffdeville) : Resque.size +* Frank Wambutt (@opinel) : Fix DST problem in `have\_scheduled` +* Luke Melia (@lukemelia) : Add `times` chained matcher +* Pablo Fernandez (@heelhook) : Add `have_queue_size_of_at_least` and `have_schedule_size_of_at_least` matchers +* (@k1w1) : Add support for enqueue_at_with_queue/enqueue_in_with_queue +* Ozéias Sant'ana (@ozeias) : Update specs to RSpec 2.10 +* Yuya Kitajima (@yuyak) : Add ResqueMailer examples to README +* Andrés Bravo (@andresbravog) : Replace `rspec` dependency with explicit dependencies Copyright ========= Copyright (c) 2010-2012 Les Hill. See LICENSE for details.