summaryrefslogtreecommitdiff
path: root/spec/controllers/abuse_reports_controller_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/controllers/abuse_reports_controller_spec.rb')
-rw-r--r--spec/controllers/abuse_reports_controller_spec.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/controllers/abuse_reports_controller_spec.rb b/spec/controllers/abuse_reports_controller_spec.rb
index ada011e7595..7104305e9d2 100644
--- a/spec/controllers/abuse_reports_controller_spec.rb
+++ b/spec/controllers/abuse_reports_controller_spec.rb
@@ -19,7 +19,7 @@ describe AbuseReportsController do
user_id = user.id
user.destroy
- get :new, { user_id: user_id }
+ get :new, params: { user_id: user_id }
expect(response).to redirect_to root_path
expect(flash[:alert]).to eq('Cannot create the abuse report. The user has been deleted.')
@@ -30,7 +30,7 @@ describe AbuseReportsController do
it 'redirects the reporter to the user\'s profile' do
user.block
- get :new, { user_id: user.id }
+ get :new, params: { user_id: user.id }
expect(response).to redirect_to user
expect(flash[:alert]).to eq('Cannot create the abuse report. This user has been blocked.')
@@ -42,18 +42,18 @@ describe AbuseReportsController do
context 'with valid attributes' do
it 'saves the abuse report' do
expect do
- post :create, abuse_report: attrs
+ post :create, params: { abuse_report: attrs }
end.to change { AbuseReport.count }.by(1)
end
it 'calls notify' do
expect_any_instance_of(AbuseReport).to receive(:notify)
- post :create, abuse_report: attrs
+ post :create, params: { abuse_report: attrs }
end
it 'redirects back to the reported user' do
- post :create, abuse_report: attrs
+ post :create, params: { abuse_report: attrs }
expect(response).to redirect_to user
end
@@ -62,7 +62,7 @@ describe AbuseReportsController do
context 'with invalid attributes' do
it 'renders new' do
attrs.delete(:user_id)
- post :create, abuse_report: attrs
+ post :create, params: { abuse_report: attrs }
expect(response).to render_template(:new)
end