From fb638f0c26d9ff5947cbab2ee9e7d239f557dea8 Mon Sep 17 00:00:00 2001 From: Luis Castro Date: Sat, 13 Jul 2019 11:19:53 +0200 Subject: [PATCH] test(shared_user_context): fix positional args warning Using positional arguments in functional tests has been deprecated --- spec/controllers/support/shared_user_context.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spec/controllers/support/shared_user_context.rb b/spec/controllers/support/shared_user_context.rb index d36579c1..c94e0deb 100644 --- a/spec/controllers/support/shared_user_context.rb +++ b/spec/controllers/support/shared_user_context.rb @@ -95,18 +95,22 @@ RSpec.shared_context :shared_user_context do # expect_any_instance_of(described_class).to receive(action).and_return(ActionDispatch::IntegrationTest.new(200)) expect_any_instance_of(described_class).to receive(:render).and_return(nil) - send(method, action, *args) + send(method, action, reduce_params(*args)) expect(response.status).to eq 200 end def reject(user_to_signin, method, action, *args) sign_in user_to_signin if user_to_signin - send(method, action, *args) + send(method, action, reduce_params(*args)) expect(response.status).to eq 302 end alias_method :redirects_to, :reject + def reduce_params(*args) + { params: args.reduce({}, :merge) } + end + def fix_args( *args) replacements = { __our_np: nonprofit.id,