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/snippets_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/snippets_spec.rb')
-rw-r--r-- | spec/requests/api/snippets_spec.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/spec/requests/api/snippets_spec.rb b/spec/requests/api/snippets_spec.rb index c546ba3e127..7c8512f7589 100644 --- a/spec/requests/api/snippets_spec.rb +++ b/spec/requests/api/snippets_spec.rb @@ -143,7 +143,7 @@ describe API::Snippets do it 'creates a new snippet' do expect do - post api("/snippets/", user), params + post api("/snippets/", user), params: params end.to change { PersonalSnippet.count }.by(1) expect(response).to have_gitlab_http_status(201) @@ -156,14 +156,14 @@ describe API::Snippets do it 'returns 400 for missing parameters' do params.delete(:title) - post api("/snippets/", user), params + post api("/snippets/", user), params: params expect(response).to have_gitlab_http_status(400) end context 'when the snippet is spam' do def create_snippet(snippet_params = {}) - post api('/snippets', user), params.merge(snippet_params) + post api('/snippets', user), params: params.merge(snippet_params) end before do @@ -205,7 +205,7 @@ describe API::Snippets do new_content = 'New content' new_description = 'New description' - put api("/snippets/#{snippet.id}", user), content: new_content, description: new_description + put api("/snippets/#{snippet.id}", user), params: { content: new_content, description: new_description } expect(response).to have_gitlab_http_status(200) snippet.reload @@ -214,14 +214,14 @@ describe API::Snippets do end it 'returns 404 for invalid snippet id' do - put api("/snippets/1234", user), title: 'foo' + put api("/snippets/1234", user), params: { title: 'foo' } expect(response).to have_gitlab_http_status(404) expect(json_response['message']).to eq('404 Snippet Not Found') end it "returns 404 for another user's snippet" do - put api("/snippets/#{snippet.id}", other_user), title: 'fubar' + put api("/snippets/#{snippet.id}", other_user), params: { title: 'fubar' } expect(response).to have_gitlab_http_status(404) expect(json_response['message']).to eq('404 Snippet Not Found') @@ -235,7 +235,7 @@ describe API::Snippets do context 'when the snippet is spam' do def update_snippet(snippet_params = {}) - put api("/snippets/#{snippet.id}", user), snippet_params + put api("/snippets/#{snippet.id}", user), params: snippet_params end before do |