diff options
author | blackst0ne <blackst0ne.ru@gmail.com> | 2018-12-18 01:52:17 +0300 |
---|---|---|
committer | blackst0ne <blackst0ne.ru@gmail.com> | 2018-12-19 02:04:31 +0300 |
commit | b44a2c801a64fb282cea794871fcfcf81e4ec539 (patch) | |
tree | 32e699b6efa548048abe11f29f84e85e3d2a034f /spec/controllers/snippets | |
parent | 5d68c23792e87e710877e4baf57605bcf11a6cb5 (diff) |
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 }`
Diffstat (limited to 'spec/controllers/snippets')
-rw-r--r-- | spec/controllers/snippets/notes_controller_spec.rb | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/spec/controllers/snippets/notes_controller_spec.rb b/spec/controllers/snippets/notes_controller_spec.rb index e6148ea1734..6efbd1f6c71 100644 --- a/spec/controllers/snippets/notes_controller_spec.rb +++ b/spec/controllers/snippets/notes_controller_spec.rb @@ -16,7 +16,7 @@ describe Snippets::NotesController do before do note_on_public - get :index, { snippet_id: public_snippet } + get :index, params: { snippet_id: public_snippet } end it "returns status 200" do @@ -35,7 +35,7 @@ describe Snippets::NotesController do context 'when user not logged in' do it "returns status 404" do - get :index, { snippet_id: internal_snippet } + get :index, params: { snippet_id: internal_snippet } expect(response).to have_gitlab_http_status(404) end @@ -47,7 +47,7 @@ describe Snippets::NotesController do end it "returns status 200" do - get :index, { snippet_id: internal_snippet } + get :index, params: { snippet_id: internal_snippet } expect(response).to have_gitlab_http_status(200) end @@ -61,7 +61,7 @@ describe Snippets::NotesController do context 'when user not logged in' do it "returns status 404" do - get :index, { snippet_id: private_snippet } + get :index, params: { snippet_id: private_snippet } expect(response).to have_gitlab_http_status(404) end @@ -73,7 +73,7 @@ describe Snippets::NotesController do end it "returns status 404" do - get :index, { snippet_id: private_snippet } + get :index, params: { snippet_id: private_snippet } expect(response).to have_gitlab_http_status(404) end @@ -87,13 +87,13 @@ describe Snippets::NotesController do end it "returns status 200" do - get :index, { snippet_id: private_snippet } + get :index, params: { snippet_id: private_snippet } expect(response).to have_gitlab_http_status(200) end it "returns 1 note" do - get :index, { snippet_id: private_snippet } + get :index, params: { snippet_id: private_snippet } expect(JSON.parse(response.body)['notes'].count).to eq(1) end @@ -110,7 +110,7 @@ describe Snippets::NotesController do end it "does not return any note" do - get :index, { snippet_id: public_snippet } + get :index, params: { snippet_id: public_snippet } expect(JSON.parse(response.body)['notes'].count).to eq(0) end @@ -132,13 +132,13 @@ describe Snippets::NotesController do end it "returns status 200" do - delete :destroy, request_params + delete :destroy, params: request_params expect(response).to have_gitlab_http_status(200) end it "deletes the note" do - expect { delete :destroy, request_params }.to change { Note.count }.from(1).to(0) + expect { delete :destroy, params: request_params }.to change { Note.count }.from(1).to(0) end context 'system note' do @@ -147,7 +147,7 @@ describe Snippets::NotesController do end it "does not delete the note" do - expect { delete :destroy, request_params }.not_to change { Note.count } + expect { delete :destroy, params: request_params }.not_to change { Note.count } end end end @@ -160,13 +160,13 @@ describe Snippets::NotesController do end it "returns status 404" do - delete :destroy, request_params + delete :destroy, params: request_params expect(response).to have_gitlab_http_status(404) end it "does not update the note" do - expect { delete :destroy, request_params }.not_to change { Note.count } + expect { delete :destroy, params: request_params }.not_to change { Note.count } end end end @@ -177,7 +177,7 @@ describe Snippets::NotesController do sign_in(user) end - subject { post(:toggle_award_emoji, snippet_id: public_snippet, id: note.id, name: "thumbsup") } + subject { post(:toggle_award_emoji, params: { snippet_id: public_snippet, id: note.id, name: "thumbsup" }) } it "toggles the award emoji" do expect { subject }.to change { note.award_emoji.count }.by(1) |