FIX: Zero is a valid value for the page parameter

This commit is contained in:
Gerhard Schlager 2018-09-05 20:43:05 +02:00
parent 1c65969bb4
commit 26082688d1
2 changed files with 4 additions and 4 deletions

View File

@ -35,7 +35,7 @@ class TopicQuery
{
max_posts: zero_up_to_max_int,
min_posts: zero_up_to_max_int,
page: one_up_to_max_int,
page: zero_up_to_max_int,
exclude_category_ids: array_int_or_int
}
end

View File

@ -30,9 +30,6 @@ RSpec.describe ListController do
get "/latest?page=-1"
expect(response.status).to eq(400)
get "/latest?page=0"
expect(response.status).to eq(400)
get "/latest?page=2147483648"
expect(response.status).to eq(400)
@ -53,6 +50,9 @@ RSpec.describe ListController do
get "/latest.json?min_posts=0"
expect(response.status).to eq(200)
get "/latest?page=0"
expect(response.status).to eq(200)
get "/latest?page=1"
expect(response.status).to eq(200)