Skip to content
Snippets Groups Projects
Commit 01ea65e0 authored by Robert Schilling's avatar Robert Schilling
Browse files

Paginate all endpoints that return an array

parent 28d8b865
No related branches found
No related tags found
No related merge requests found
Loading
@@ -507,8 +507,11 @@ describe API::Users, api: true do
Loading
@@ -507,8 +507,11 @@ describe API::Users, api: true do
it 'returns array of ssh keys' do it 'returns array of ssh keys' do
user.keys << key user.keys << key
user.save user.save
get api("/users/#{user.id}/keys", admin) get api("/users/#{user.id}/keys", admin)
expect(response).to have_http_status(200) expect(response).to have_http_status(200)
expect(response).to include_pagination_headers
expect(json_response).to be_an Array expect(json_response).to be_an Array
expect(json_response.first['title']).to eq(key.title) expect(json_response.first['title']).to eq(key.title)
end end
Loading
@@ -774,8 +777,11 @@ describe API::Users, api: true do
Loading
@@ -774,8 +777,11 @@ describe API::Users, api: true do
it "returns array of ssh keys" do it "returns array of ssh keys" do
user.keys << key user.keys << key
user.save user.save
get api("/user/keys", user) get api("/user/keys", user)
expect(response).to have_http_status(200) expect(response).to have_http_status(200)
expect(response).to include_pagination_headers
expect(json_response).to be_an Array expect(json_response).to be_an Array
expect(json_response.first["title"]).to eq(key.title) expect(json_response.first["title"]).to eq(key.title)
end end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment