Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/rspec/rails/matchers/active_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ def detect_args_signature_mismatch(jobs)
end

def skip_signature_verification?
return true unless defined?(::RSpec::Mocks) && (::RSpec::Mocks.respond_to?(:configuration))

!RSpec::Mocks.configuration.verify_partial_doubles? ||
RSpec::Mocks.configuration.temporarily_suppress_partial_double_verification
end
Expand Down
12 changes: 12 additions & 0 deletions spec/rspec/rails/matchers/active_job_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,18 @@ def perform; raise StandardError; end
}
end
end

context "without rspec-mocks loaded" do
before do
# Its hard for us to unload this, but its fairly safe to assume that we can run
# a defined? check, this just mocks the "short circuit"
allow(::RSpec::Mocks).to receive(:respond_to?).with(:configuration) { false }
end

it "skips signature checks" do
expect { two_args_job.perform_later(1) }.to have_enqueued_job.with(1)
end
end
end

it "passes with provided arguments containing global id object" do
Expand Down