Skip to content

Commit

Permalink
check headers in rails/convert_rails_test_request_methods_4_2_to_5_0 …
Browse files Browse the repository at this point in the history
…snippet
  • Loading branch information
flyerhzm committed Feb 2, 2021
1 parent 1417ac3 commit 56112c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/rails/convert_rails_test_request_methods_4_2_to_5_0.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def make_up_hash_pair(key, argument_node)
%w(get post put patch delete).each do |message|
with_node type: 'send', message: message do
next unless node.arguments.size > 1
next if node.arguments[1].type == :hash && node.arguments[1].has_key?(:params)
next if node.arguments[1].type == :hash && (node.arguments[1].has_key?(:params) || node.arguments[1].has_key?(:headers))

def make_up_hash_pair(key, argument_node)
if argument_node.to_source != 'nil'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def test_destroy
end
it 'tests index' do
get '/posts', nil, { 'HTTP_AUTHORIZATION' => 'fake' }
get '/posts', headers: { 'HTTP_AUTHORIZATION' => 'fake' }
end
it 'tests create' do
Expand Down

0 comments on commit 56112c1

Please sign in to comment.