Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

should respond to has_valid_sidekiq_options? #822

Closed
cl-nandini opened this issue Dec 4, 2023 · 4 comments
Closed

should respond to has_valid_sidekiq_options? #822

cl-nandini opened this issue Dec 4, 2023 · 4 comments

Comments

@cl-nandini
Copy link

Describe the bug
Gem Version 'sidekiq-unique-jobs', '= 5.0.10'

As per the readme, trying to validate options using rspec.

#spec/workers/contacts_communication_info_spec.rb
require 'spec_helper'
require "sidekiq_unique_jobs/testing"

RSpec.describe Contacts::CommunicationInfo do
  specify { expect(described_class).to have_valid_sidekiq_options }
end

Expected behavior
Expected Contacts::CommunicationInfo to have valid sidekiq options but found the following problems

Current behavior

Contacts::CommunicationInfo is expected to have valid sidekiq options
     Failure/Error: specify { expect(described_class).to have_valid_sidekiq_options }
       expected Contacts::CommunicationInfo to respond to `has_valid_sidekiq_options?`

Worker class

module Contacts
  # Worker to call interactor for CommunicationInfo update
  class CommunicationInfo
    include Sidekiq::Worker
    sidekiq_options unique_across_queues: true, queue: 'api_p1', lock: :while_executing, on_conflict: :log

    def perform(contact_id, changed_keys); end

end
@mhenrixon
Copy link
Owner

Thank you for the detailed report. Admittedly this is my first attempt at sharing an RSpec matcher/expectation.

I'll have a look at this.

@cl-nandini
Copy link
Author

I was using older version of gem.

@mhenrixon
Copy link
Owner

I was using an older version of gem.

🤣 that is something I would do. I have (more often than I like to admit), spent a day debugging something like that to realize I have like a typo.

@cl-nandini
Copy link
Author

apologies! if this has consumed your precious time :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants