ruby on rails - Stub set later on perform_later ActiveJob -


i'm trying stub out activejob method in rspec cannot fiddle out. i'm having email send class mailchimp mailinglistunsubscribejob. call is:

mailinglistunsubscribejob.set(wait: 20.days).perform_later(subject: user, list: "activation") 

usually in rspec when not having set(wait: 20.days) have perform_later following in specs:

allow(mailinglistunsubscribejob).to receive(:perform_later) 

but not work. idea?

since using rspec already, can use rpec-activejob.

it has matchers need:

if job uses set(wait_until: time), can use .to_run_at(time) chain after enqueue_a call well.


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -