Skip to content

Commit

Permalink
Move {get,post}_via_redirect into conditional
Browse files Browse the repository at this point in the history
Co-authored-by: Aubin Lorieux <aubin.lorieux@gmail.com>
  • Loading branch information
jhawthorn and aubinlrx committed May 5, 2020
1 parent e7b4e8a commit 0991ab7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/rails/controller/testing/integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ module Rails
module Controller
module Testing
module Integration
http_verbs = %w(get post patch put head delete get_via_redirect post_via_redirect)
http_verbs.push('xhr', 'xml_http_request') if ActionPack.version < Gem::Version.new('5.1')
http_verbs = %w(get post patch put head delete)

if ActionPack.version < Gem::Version.new('5.1')
http_verbs.push('xhr', 'xml_http_request', 'get_via_redirect', 'post_via_redirect')
end

http_verbs.each do |method|
define_method(method) do |*args, **kwargs|
Expand Down

0 comments on commit 0991ab7

Please sign in to comment.