From 6024627680c17a54a24e1bd5d78416cf251562d0 Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Mon, 22 Apr 2019 14:03:22 -0300 Subject: [PATCH 1/1] 14988: Removes almost all pending deprecated warnings on functional tests. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- apps/workbench/Gemfile | 1 + apps/workbench/Gemfile.lock | 5 +++++ apps/workbench/app/controllers/actions_controller.rb | 4 ++-- apps/workbench/app/models/arvados_base.rb | 3 +++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/workbench/Gemfile b/apps/workbench/Gemfile index 08cf436f63..30c5bfce83 100644 --- a/apps/workbench/Gemfile +++ b/apps/workbench/Gemfile @@ -58,6 +58,7 @@ group :test, :performance do gem 'simplecov', '~> 0.7', require: false gem 'simplecov-rcov', require: false gem 'mocha', require: false + gem 'rails-controller-testing' end gem 'jquery-rails' diff --git a/apps/workbench/Gemfile.lock b/apps/workbench/Gemfile.lock index d1ea71a850..a4c9c24b6b 100644 --- a/apps/workbench/Gemfile.lock +++ b/apps/workbench/Gemfile.lock @@ -228,6 +228,10 @@ GEM bundler (>= 1.3.0) railties (= 5.0.7.2) sprockets-rails (>= 2.0.0) + rails-controller-testing (1.0.4) + actionpack (>= 5.0.1.x) + actionview (>= 5.0.1.x) + activesupport (>= 5.0.1.x) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) @@ -348,6 +352,7 @@ DEPENDENCIES poltergeist (~> 1.5.1) rack-mini-profiler rails (~> 5.0.0) + rails-controller-testing rails-perftest raphael-rails responders (~> 2.0) diff --git a/apps/workbench/app/controllers/actions_controller.rb b/apps/workbench/app/controllers/actions_controller.rb index 7e9e292332..065dce5219 100644 --- a/apps/workbench/app/controllers/actions_controller.rb +++ b/apps/workbench/app/controllers/actions_controller.rb @@ -14,8 +14,8 @@ class ActionsController < ApplicationController params['uuid'] and model_class.in?([Collection, Group, Job, PipelineInstance, PipelineTemplate]) } - skip_filter :require_thread_api_token, only: [:report_issue_popup, :report_issue] - skip_filter :check_user_agreements, only: [:report_issue_popup, :report_issue] + skip_around_action :require_thread_api_token, only: [:report_issue_popup, :report_issue] + skip_before_action :check_user_agreements, only: [:report_issue_popup, :report_issue] @@exposed_actions = {} def self.expose_action method, &block diff --git a/apps/workbench/app/models/arvados_base.rb b/apps/workbench/app/models/arvados_base.rb index 5dd585152e..aa25ac4390 100644 --- a/apps/workbench/app/models/arvados_base.rb +++ b/apps/workbench/app/models/arvados_base.rb @@ -185,6 +185,9 @@ class ArvadosBase < ApplicationRecord # The following permit! is necessary even with # "ActionController::Parameters.permit_all_parameters = true", # because permit_all does not permit nested attributes. + if raw_params.is_a? ActionController::Parameters + raw_params = raw_params.to_unsafe_h + end ActionController::Parameters.new(raw_params).permit! end -- 2.30.2