Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZ.J. van de Weg <zegerjan@gitlab.com>2016-06-27 21:10:42 +0300
committerZ.J. van de Weg <zegerjan@gitlab.com>2016-06-27 21:10:42 +0300
commitabca19da8b0ec12548140f8e771cfc08968d6972 (patch)
tree1db15dba43c2f51a423b8f71a1dbb87e5ea332e2 /spec/requests/api/keys_spec.rb
parente0e325625eb141445720999d4e4a4d60a4b59d95 (diff)
Use HTTP matchers if possible
Diffstat (limited to 'spec/requests/api/keys_spec.rb')
-rw-r--r--spec/requests/api/keys_spec.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/requests/api/keys_spec.rb b/spec/requests/api/keys_spec.rb
index d2b87f88712..1861882d59e 100644
--- a/spec/requests/api/keys_spec.rb
+++ b/spec/requests/api/keys_spec.rb
@@ -14,14 +14,14 @@ describe API::API, api: true do
context 'when unauthenticated' do
it 'should return authentication error' do
get api("/keys/#{key.id}")
- expect(response.status).to eq(401)
+ expect(response).to have_http_status(401)
end
end
context 'when authenticated' do
it 'should return 404 for non-existing key' do
get api('/keys/999999', admin)
- expect(response.status).to eq(404)
+ expect(response).to have_http_status(404)
expect(json_response['message']).to eq('404 Not found')
end
@@ -29,7 +29,7 @@ describe API::API, api: true do
user.keys << key
user.save
get api("/keys/#{key.id}", admin)
- expect(response.status).to eq(200)
+ expect(response).to have_http_status(200)
expect(json_response['title']).to eq(key.title)
expect(json_response['user']['id']).to eq(user.id)
expect(json_response['user']['username']).to eq(user.username)