14 Jan '13, 6pm

Process Jobs Inline when Running Acceptance Tests

January 14, 2013 jdclayton rails test-driven development Process Jobs Inline when Running Acceptance Tests Web apps often move long-running processes (such as delivering email) out of the request/response cycle into a queue of background jobs. A worker process then picks up those jobs from the queue and runs them in the background. In acceptance tests, it’s desirable to run those background jobs immediately, skipping the queueing component, to avoid writing custom code to work the jobs off. Configure RSpec request specs with a custom run_background_jobs_immediately method: RSpec.configure do |config| # if you're using Capybara 1.x, :feature should be replaced with :request config.around(:each, type: :feature) do |example| run_background_jobs_immediately do example.run end end config.include BackgroundJobs end A Delayed::Job implementation of the method: # spec/support/back...

Full article: http://robots.thoughtbot.com/post/40526170520/process-job...

Tweets

Running in Rome!!

ronisweigh.com 14 Jan '13, 7am

I’ll be preaching it to my dying day: Food that’s fun, takes just a little time to prep, and look pretty is always more sa...

More on jobs...

green-buildings.com 16 Jan '13, 6pm

Advice provided by: Claire Moloney, LEED Green Associate, Cornell University Share Tweet EPA and DOE Open Contaminated Lan...

Running 101: How Often Should You Run? via @Run...

running.competitor.com 16 Jan '13, 12am

Frequency—or how often you run—is one of three fundamental variables of training. The other two are duration (how far you ...

How to Define a Web Analytics Process to Drive Better Insights

How to Define a Web Analytics Process to Drive ...

searchenginewatch.com 16 Jan '13, 8am

Customization of data collection code is of paramount importance to web analysts because it constitutes the fundamental bu...