test(shared_user_context): fix positional args warning
Using positional arguments in functional tests has been deprecated
This commit is contained in:
parent
57125774ef
commit
fb638f0c26
1 changed files with 6 additions and 2 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue