summaryrefslogtreecommitdiff
path: root/spec/requests/api/snippets_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/requests/api/snippets_spec.rb')
-rw-r--r--spec/requests/api/snippets_spec.rb14
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