From b44a2c801a64fb282cea794871fcfcf81e4ec539 Mon Sep 17 00:00:00 2001 From: blackst0ne Date: Tue, 18 Dec 2018 09:52:17 +1100 Subject: Update specs to rails5 format Updates specs to use new rails5 format. The old format: `get :show, { some: params }, { some: headers }` The new format: `get :show, params: { some: params }, headers: { some: headers }` --- spec/controllers/users/terms_controller_spec.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'spec/controllers/users') diff --git a/spec/controllers/users/terms_controller_spec.rb b/spec/controllers/users/terms_controller_spec.rb index 0d77e91a67d..cbfd2b17864 100644 --- a/spec/controllers/users/terms_controller_spec.rb +++ b/spec/controllers/users/terms_controller_spec.rb @@ -40,7 +40,7 @@ describe Users::TermsController do describe 'POST #accept' do it 'saves that the user accepted the terms' do - post :accept, id: term.id + post :accept, params: { id: term.id } agreement = user.term_agreements.find_by(term: term) @@ -48,7 +48,7 @@ describe Users::TermsController do end it 'redirects to a path when specified' do - post :accept, id: term.id, redirect: groups_path + post :accept, params: { id: term.id, redirect: groups_path } expect(response).to redirect_to(groups_path) end @@ -56,14 +56,14 @@ describe Users::TermsController do it 'redirects to the referer when no redirect specified' do request.env["HTTP_REFERER"] = groups_url - post :accept, id: term.id + post :accept, params: { id: term.id } expect(response).to redirect_to(groups_path) end context 'redirecting to another domain' do it 'is prevented when passing a redirect param' do - post :accept, id: term.id, redirect: '//example.com/random/path' + post :accept, params: { id: term.id, redirect: '//example.com/random/path' } expect(response).to redirect_to(root_path) end @@ -71,7 +71,7 @@ describe Users::TermsController do it 'is prevented when redirecting to the referer' do request.env["HTTP_REFERER"] = 'http://example.com/and/a/path' - post :accept, id: term.id + post :accept, params: { id: term.id } expect(response).to redirect_to(root_path) end @@ -80,7 +80,7 @@ describe Users::TermsController do describe 'POST #decline' do it 'stores that the user declined the terms' do - post :decline, id: term.id + post :decline, params: { id: term.id } agreement = user.term_agreements.find_by(term: term) @@ -88,7 +88,7 @@ describe Users::TermsController do end it 'signs out the user' do - post :decline, id: term.id + post :decline, params: { id: term.id } expect(response).to redirect_to(root_path) expect(assigns(:current_user)).to be_nil -- cgit v1.2.3