mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 20:22:45 +08:00
FIX: Zero is a valid value for the page parameter
This commit is contained in:
parent
1c65969bb4
commit
26082688d1
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user