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,