summaryrefslogtreecommitdiffstats
path: root/test/test_helper.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-05-31 17:32:34 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-05-31 17:32:34 +0000
commitb834e81d7f41121fc6d9bef95ee090f8f466493e (patch)
tree61fddb6214c64e96fddd504301029bdb382ba439 /test/test_helper.rb
parent1d4300b674f739d671a8be22d3ea617922f16517 (diff)
downloadredmine-b834e81d7f41121fc6d9bef95ee090f8f466493e.tar.gz
redmine-b834e81d7f41121fc6d9bef95ee090f8f466493e.zip
Use Rails 5 syntax for functional tests.
git-svn-id: http://svn.redmine.org/redmine/trunk@16585 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/test_helper.rb')
-rw-r--r--test/test_helper.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/test_helper.rb b/test/test_helper.rb
index 4cee54472..19a60c838 100644
--- a/test/test_helper.rb
+++ b/test/test_helper.rb
@@ -320,10 +320,12 @@ module Redmine
assert_equal expected_filters.size, filter_init.scan("addFilter").size, "filters counts don't match"
end
- def process(method, path, parameters={}, session={}, flash={})
- if parameters.key?(:params) || parameters.key?(:session)
- raise ArgumentError if session.present?
- super method, path, parameters[:params], parameters[:session], parameters.except(:params, :session)
+ def process(action, http_method = 'GET', *args)
+ parameters, session, flash = *args
+ if args.size == 1 && parameters[:xhr] == true
+ xhr http_method.downcase.to_sym, action, parameters.except(:xhr)
+ elsif parameters && (parameters.key?(:params) || parameters.key?(:session) || parameters.key?(:flash))
+ super action, http_method, parameters[:params], parameters[:session], parameters[:flash]
else
super
end