Skip to content

Commit

Permalink
Remove code to support Rails 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelfranca committed Jun 21, 2019
1 parent e056769 commit 02a1807
Showing 1 changed file with 3 additions and 28 deletions.
31 changes: 3 additions & 28 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,35 +43,10 @@ class ActiveSupport::TestCase
end
end

if ActionPack::VERSION::STRING >= "5.0.0"
require "rails-controller-testing"

ActionController::TestCase.include Rails::Controller::Testing::TestProcess
ActionController::TestCase.include Rails::Controller::Testing::TemplateAssertions
else
# TODO: Remove this compatibility monkeypatch when we drop support for Rails 4.2.
class ActionController::TestCase
def post(action, options = {})
params = options.delete(:params) || {}
super(action, params.merge(options))
end

def put(action, options = {})
params = options.delete(:params) || {}
super(action, params.merge(options))
end

def delete(action, options = {})
params = options.delete(:params) || {}
super(action, params.merge(options))
end
require "rails-controller-testing"

def get(action, options = {})
params = options.delete(:params) || {}
super(action, params.merge(options))
end
end
end
ActionController::TestCase.include Rails::Controller::Testing::TestProcess
ActionController::TestCase.include Rails::Controller::Testing::TemplateAssertions

module ActionDispatch
class Flash
Expand Down

0 comments on commit 02a1807

Please # to comment.