Log In
Log In
Places
All Projects
Status Monitor
Collapse sidebar
obs:server:fedora:2.8:testing
obs-server
obs-server-2.8-0103-ci-Rails-5.1-Update-overwri...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File obs-server-2.8-0103-ci-Rails-5.1-Update-overwrite-of-ActionDispatch-Inte.patch of Package obs-server
From 4b4bdbc9d1ccfb809c49aae9c0d79ce3c44dc317 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Geuken?= <bgeuken@suse.de> Date: Tue, 20 Jun 2017 11:23:49 +0200 Subject: [PATCH] [ci] Rails 5.1: Update overwrite of ActionDispatch::Integration::Session In rails 5.1 using keyword arguments for get, post, put, etc. got dropped. This commit adjusts the code to not handle this kind of arguments. --- src/api/test/test_helper.rb | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/api/test/test_helper.rb b/src/api/test/test_helper.rb index dc013c112..a3b35280c 100644 --- a/src/api/test/test_helper.rb +++ b/src/api/test/test_helper.rb @@ -165,39 +165,35 @@ module ActionDispatch if !headers.has_key?("HTTP_AUTHORIZATION") && IntegrationTest.basic_auth headers["HTTP_AUTHORIZATION"] = IntegrationTest.basic_auth end + headers end - alias real_process process_with_kwargs + alias_method :real_process, :process - def process_with_kwargs(http_method, path, *args) + def process(http_method, path, params: nil, headers: nil, env: nil, xhr: false, as: nil) CONFIG['global_write_through'] = true # Hack to pass the APIMatcher (config/routes.rb) without # explicitly setting format: xml self.accept = 'text/xml,application/xml' - if kwarg_request?(args) - parameters = args[0] - parameters[:headers] = add_auth(parameters[:headers]) - real_process(http_method, path, parameters) - else - real_process(http_method, path, params: args[0], headers: add_auth(args[1])) - end + + real_process(http_method, path, params: params, headers: add_auth(headers), env: env, xhr: xhr, as: as) end - def raw_post(path, data, parameters = {}, rack_env = nil) - rack_env ||= {} + def raw_post(path, data) + rack_env = {} rack_env['CONTENT_TYPE'] ||= 'application/octet-stream' rack_env['CONTENT_LENGTH'] = data.length rack_env['RAW_POST_DATA'] = data - process_with_kwargs(:post, path, parameters, add_auth(rack_env)) + process(:post, path, env: add_auth(rack_env)) end - def raw_put(path, data, parameters = {}, rack_env = nil) + def raw_put(path, data) rack_env ||= {} rack_env['CONTENT_TYPE'] ||= 'application/octet-stream' rack_env['CONTENT_LENGTH'] = data.length rack_env['RAW_POST_DATA'] = data - process_with_kwargs(:put, path, parameters, add_auth(rack_env)) + process(:put, path, env: add_auth(rack_env)) end end end -- 2.14.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Contact
Support
@OBShq
The Open Build Service is an
openSUSE project
.
Log In
Places
Places
All Projects
Status Monitor