Skip to content

Commit cc499d4

Browse files
committed
fix: add response object to address failures relating to @Actual parameter
1 parent e895734 commit cc499d4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/rubocop/cop/rspec_rails/minitest_assertions.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,15 +323,16 @@ class ResponseAssertion < BasicAssertion
323323

324324
# @!method self.minitest_assertion(node)
325325
def_node_matcher 'self.minitest_assertion', <<~PATTERN # rubocop:disable InternalAffairs/NodeMatcherDirective
326-
(send nil? :assert_response $_ $_?)
326+
(send nil? {:assert_response} $_ $_?)
327327
PATTERN
328328

329329
def self.match(expected, failure_message)
330-
new(expected, nil, failure_message.first)
330+
response = Struct.new(:source).new('response')
331+
new(expected, response, failure_message.first)
331332
end
332333

333334
def assertion
334-
"have_http_status(#{expected.source})"
335+
"have_http_status(#{expected})"
335336
end
336337
end
337338

0 commit comments

Comments
 (0)