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/requests/api/award_emoji_spec.rb | |
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/requests/api/award_emoji_spec.rb')
-rw-r--r-- | spec/requests/api/award_emoji_spec.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/spec/requests/api/award_emoji_spec.rb b/spec/requests/api/award_emoji_spec.rb index 7f3f3ab0977..22f6fcdc922 100644 --- a/spec/requests/api/award_emoji_spec.rb +++ b/spec/requests/api/award_emoji_spec.rb @@ -148,7 +148,7 @@ describe API::AwardEmoji do context "on an issue" do it "creates a new award emoji" do - post api("/projects/#{project.id}/issues/#{issue.iid}/award_emoji", user), name: 'blowfish' + post api("/projects/#{project.id}/issues/#{issue.iid}/award_emoji", user), params: { name: 'blowfish' } expect(response).to have_gitlab_http_status(201) expect(json_response['name']).to eq('blowfish') @@ -162,21 +162,21 @@ describe API::AwardEmoji do end it "returns a 401 unauthorized error if the user is not authenticated" do - post api("/projects/#{project.id}/issues/#{issue.iid}/award_emoji"), name: 'thumbsup' + post api("/projects/#{project.id}/issues/#{issue.iid}/award_emoji"), params: { name: 'thumbsup' } expect(response).to have_gitlab_http_status(401) end it "normalizes +1 as thumbsup award" do - post api("/projects/#{project.id}/issues/#{issue.iid}/award_emoji", user), name: '+1' + post api("/projects/#{project.id}/issues/#{issue.iid}/award_emoji", user), params: { name: '+1' } expect(issue.award_emoji.last.name).to eq("thumbsup") end context 'when the emoji already has been awarded' do it 'returns a 404 status code' do - post api("/projects/#{project.id}/issues/#{issue.iid}/award_emoji", user), name: 'thumbsup' - post api("/projects/#{project.id}/issues/#{issue.iid}/award_emoji", user), name: 'thumbsup' + post api("/projects/#{project.id}/issues/#{issue.iid}/award_emoji", user), params: { name: 'thumbsup' } + post api("/projects/#{project.id}/issues/#{issue.iid}/award_emoji", user), params: { name: 'thumbsup' } expect(response).to have_gitlab_http_status(404) expect(json_response["message"]).to match("has already been taken") @@ -188,7 +188,7 @@ describe API::AwardEmoji do it 'creates a new award emoji' do snippet = create(:project_snippet, :public, project: project) - post api("/projects/#{project.id}/snippets/#{snippet.id}/award_emoji", user), name: 'blowfish' + post api("/projects/#{project.id}/snippets/#{snippet.id}/award_emoji", user), params: { name: 'blowfish' } expect(response).to have_gitlab_http_status(201) expect(json_response['name']).to eq('blowfish') @@ -202,7 +202,7 @@ describe API::AwardEmoji do it 'creates a new award emoji' do expect do - post api("/projects/#{project.id}/issues/#{issue.iid}/notes/#{note.id}/award_emoji", user), name: 'rocket' + post api("/projects/#{project.id}/issues/#{issue.iid}/notes/#{note.id}/award_emoji", user), params: { name: 'rocket' } end.to change { note.award_emoji.count }.from(0).to(1) expect(response).to have_gitlab_http_status(201) @@ -210,15 +210,15 @@ describe API::AwardEmoji do end it "normalizes +1 as thumbsup award" do - post api("/projects/#{project.id}/issues/#{issue.iid}/notes/#{note.id}/award_emoji", user), name: '+1' + post api("/projects/#{project.id}/issues/#{issue.iid}/notes/#{note.id}/award_emoji", user), params: { name: '+1' } expect(note.award_emoji.last.name).to eq("thumbsup") end context 'when the emoji already has been awarded' do it 'returns a 404 status code' do - post api("/projects/#{project.id}/issues/#{issue.iid}/notes/#{note.id}/award_emoji", user), name: 'rocket' - post api("/projects/#{project.id}/issues/#{issue.iid}/notes/#{note.id}/award_emoji", user), name: 'rocket' + post api("/projects/#{project.id}/issues/#{issue.iid}/notes/#{note.id}/award_emoji", user), params: { name: 'rocket' } + post api("/projects/#{project.id}/issues/#{issue.iid}/notes/#{note.id}/award_emoji", user), params: { name: 'rocket' } expect(response).to have_gitlab_http_status(404) expect(json_response["message"]).to match("has already been taken") |