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/project_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/project_snippets_spec.rb')
-rw-r--r-- | spec/requests/api/project_snippets_spec.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/spec/requests/api/project_snippets_spec.rb b/spec/requests/api/project_snippets_spec.rb index 5dec0bc778c..29f69b6ce20 100644 --- a/spec/requests/api/project_snippets_spec.rb +++ b/spec/requests/api/project_snippets_spec.rb @@ -97,7 +97,7 @@ describe API::ProjectSnippets do end it 'creates a new snippet' do - post api("/projects/#{project.id}/snippets/", admin), params + post api("/projects/#{project.id}/snippets/", admin), params: params expect(response).to have_gitlab_http_status(201) snippet = ProjectSnippet.find(json_response['id']) @@ -111,7 +111,7 @@ describe API::ProjectSnippets do it 'returns 400 for missing parameters' do params.delete(:title) - post api("/projects/#{project.id}/snippets/", admin), params + post api("/projects/#{project.id}/snippets/", admin), params: params expect(response).to have_gitlab_http_status(400) end @@ -119,7 +119,7 @@ describe API::ProjectSnippets do it 'returns 400 for empty code field' do params[:code] = '' - post api("/projects/#{project.id}/snippets/", admin), params + post api("/projects/#{project.id}/snippets/", admin), params: params expect(response).to have_gitlab_http_status(400) end @@ -128,7 +128,7 @@ describe API::ProjectSnippets do def create_snippet(project, snippet_params = {}) project.add_developer(user) - post api("/projects/#{project.id}/snippets", user), params.merge(snippet_params) + post api("/projects/#{project.id}/snippets", user), params: params.merge(snippet_params) end before do @@ -167,7 +167,7 @@ describe API::ProjectSnippets do new_content = 'New content' new_description = 'New description' - put api("/projects/#{snippet.project.id}/snippets/#{snippet.id}/", admin), code: new_content, description: new_description + put api("/projects/#{snippet.project.id}/snippets/#{snippet.id}/", admin), params: { code: new_content, description: new_description } expect(response).to have_gitlab_http_status(200) snippet.reload @@ -176,7 +176,7 @@ describe API::ProjectSnippets do end it 'returns 404 for invalid snippet id' do - put api("/projects/#{snippet.project.id}/snippets/1234", admin), title: 'foo' + put api("/projects/#{snippet.project.id}/snippets/1234", admin), params: { title: 'foo' } expect(response).to have_gitlab_http_status(404) expect(json_response['message']).to eq('404 Snippet Not Found') @@ -191,14 +191,14 @@ describe API::ProjectSnippets do it 'returns 400 for empty code field' do new_content = '' - put api("/projects/#{snippet.project.id}/snippets/#{snippet.id}/", admin), code: new_content + put api("/projects/#{snippet.project.id}/snippets/#{snippet.id}/", admin), params: { code: new_content } expect(response).to have_gitlab_http_status(400) end context 'when the snippet is spam' do def update_snippet(snippet_params = {}) - put api("/projects/#{snippet.project.id}/snippets/#{snippet.id}", admin), snippet_params + put api("/projects/#{snippet.project.id}/snippets/#{snippet.id}", admin), params: snippet_params end before do |