Questions tagged [rspec-sidekiq]

Simple testing of Sidekiq jobs via a collection of matchers and helpers

Simple testing of Sidekiq jobs via a collection of matchers and helpers

The official repository is https://github.com/philostler/rspec-sidekiq

26 questions
1
vote
1 answer

rspec-sidekiq have_enqueued_sidekiq_job undefined method at

expect(MyWorker).to have_enqueued_sidekiq_job().at(Time.now) causing me to get this error undefined method at for #RSpec::Matchers::BuiltIn::Has:0x007fecb7f0a068` Here are my rspec Gems rspec (3.6.0) rspec-core (3.6.0) rspec-expectations…
Maged Makled
  • 1,918
  • 22
  • 25
1
vote
1 answer

Sidekiq testing perform_in

I wonder if there's anyway to test whether sidekiq properly executes a job in X seconds(or enqueues a job to be performed in X seconds), as specified in a perform_in call. As far as I can tell, the docs don't allude to any mode that allows this. In…
Phil
  • 307
  • 2
  • 17
1
vote
0 answers

Can't run my rspec test with jRuby and Rails 4.1.4

I have a Rails application (4.1.4) running with jRuby 1.7.15 (1.9.3p392) 2014-09-03 82b5cc3 on Java HotSpot(TM) 64-Bit Server VM 1.7.0_67-b01. You can see my Gemfile at: https://gist.github.com/eqbal/fe9477ddc20c6a9088fb. My Gemfile.lock:…
Eki Eqbal
  • 5,779
  • 9
  • 47
  • 81
1
vote
1 answer

Sidekiq tries to run in test environment

I have a very strange issue: Sidekiq tries to establish connection to Redis in test environment. I'm using sidekiq 3.2.2 with rspec-sidekiq 2.0.0.beta on rails 4.1.4 with ruby 2.1.2 Here is my test require 'rails_helper' describe…
retgoat
  • 2,414
  • 1
  • 16
  • 21
0
votes
1 answer

Worker Spec is Failing

I have a worker and I am writing specs for success and failure condition. if http_response.success? "Login Event Success" else raise "Login Event Failed" end Error is in this format: "{\n \"status\" : 400,\n \"error\" : \"Bad…
Kumar Nikhil
  • 99
  • 1
  • 11
0
votes
0 answers

Don't understand why Sidekiq tests are failing with Testing::inline! when others wont

I am about to write tests for a Imaage Worker. I don't understand why some of the tests are failing when using Sidekiq::Testing.inline! when others with the same structure wont. Can someone explain please why the first test fails WITH…
Jan
  • 12,992
  • 9
  • 53
  • 89
0
votes
1 answer

Expect Sidekiq Job to receive Async with arguments Rspec

I have the following Worker class JobBlastingWorker include Sidekiq::Worker sidekiq_options queue: 'job_blasting_worker' def perform(job_id, action=nil) job = Job.find(job_id) JobBlastingService.new(job).call end end I also have…
Kingsley Simon
  • 2,090
  • 5
  • 38
  • 84
0
votes
1 answer

Rspec How to test if a Sidekiq Job was scheduled to run at a certain time

I have the following Worker class JobBlastingWorker include Sidekiq::Worker sidekiq_options queue: 'job_blasting_worker' def perform(job_id, action=nil) job = Job.find(job_id) JobBlastingService.new(job).call sidekiq_id =…
Kingsley Simon
  • 2,090
  • 5
  • 38
  • 84
0
votes
0 answers

ActionMailer::Base.deliveries is giving blank array when i am using sidekiq ? any configuration do we need to do for that

ActionMailer::Base.deliveries are giving blank array when i am using sidekiq ? any configuration do we need to do for that My test.rb looks like this In development mode it is working fine and even from test sidekiq shows no…
0
votes
1 answer

Sidekiq with Heroku & Rails : my Jobs are stucks in queue on Heroku

Solution EDIT : The worker button on Heroku was not turned from Off to On... I'm trying to use Sidekiq on my RailsApp. The configuration works fine in development but in Product with Heroku, all Jobs are enqued but stuck in queue. Some insight…
user10089436
0
votes
1 answer

Testing unmarshalling of asynchronous ActionMailer methods using Sidekiq

TLDR; How can I test that a PORO argument for an asynchronous ActionMailer action (using Sidekiq) serializes and deserializes correctly? Sidekiq provides RSpec matchers for testing that a job is enqueued and performing a job (with given…
David Milanese
  • 370
  • 4
  • 17
1
2