Skip to content

Instantly share code, notes, and snippets.

@jmzbond
jmzbond / gist:17342b91fa437a6c339e
Last active August 29, 2015 14:08
Sucker Punch testing
# REVISED TEST FILES
describe TwilioController, job: true do
before { @rentalrequest = FactoryGirl.create(:rental_request) }
it "enqueues a RoadRunner Twilio Alert job" do
get :alert, rentalrequest_id: @rentalrequest.id
RoadrunnerTwilioAlert.jobs.count.should == 1 # not sure what the right syntax is here?
end
@jmzbond
jmzbond / SP Test errors
Created August 27, 2014 18:22
Logged errors when testing SP
#Note, these results are the exact same whether or not I have the db gem installed and the config files or not.
#Either tell the job to sleep 3 sec before starting OR don't sleep and execute as normal both render the following errors
Failure/Error: click_button 'submit_request'
NoMethodError:
undefined method `signup' for nil:NilClass
# ./app/jobs/times_to_create.rb:12:in `block (2 levels) in perform'
# ./app/jobs/times_to_create.rb:8:in `each'
# ./app/jobs/times_to_create.rb:8:in `block in perform'
#config/initializers/fist_of_fury.rb
# Ensure the jobs run only in a web server.
if defined?(Rails::Server)
FistOfFury.attack! do
# Jobs can be scheduled here. Example:
# SayHiJob.recurs { secondly(3) }
end
end