Skip to content

Commit

Permalink
Deprecated style. DEPRECATION WARNING: Using positional arguments in …
Browse files Browse the repository at this point in the history
…functional tests has been deprecated in favor of keyword arguments, and will be removed in Rails 5.1. (#353)

add key `params` when declaring params for request in specs
  • Loading branch information
yuenmichelle1 authored Aug 8, 2024
1 parent 3797fac commit b32fed1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion spec/support/shared_examples_for_controller_actions.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'spec_helper'

RSpec.shared_examples_for 'a controller action' do
let(:send_request){ send verb, action, params.merge(format: :json) }
let(:send_request){ send verb, action, params: params.merge(format: :json) }

it 'should authorize the action' do
if authorizable
Expand Down
2 changes: 1 addition & 1 deletion spec/support/shared_examples_for_controller_creating.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
end

describe '#create' do
let(:send_request){ post :create, request_params.merge(format: :json) }
let(:send_request){ post :create, params: request_params.merge(format: :json) }

it 'should authorize the action' do
expect_any_instance_of(subject.service_class).to receive :authorize
Expand Down
2 changes: 1 addition & 1 deletion spec/support/shared_examples_for_controller_rendering.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

it 'should serialize the resource' do
expect(subject.serializer_class).to receive(:resource).and_call_original
get :show, id: record.id
get :show, params: { id: record.id }
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/support/shared_examples_for_controller_updating.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
end

describe '#update' do
let(:send_request){ put :update, request_params.merge(format: :json) }
let(:send_request){ put :update, params: request_params.merge(format: :json) }

it 'should authorize the action' do
expect_any_instance_of(subject.service_class).to receive :authorize
Expand Down

0 comments on commit b32fed1

Please sign in to comment.