mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 11:48:26 -06:00
DEV: Fix flaky test (#25935)
Returned results are ordered by ID, but the fabricated category and private_category IDs are not always generated in the same order. This caused the expected and actual results to be in different orders.
This commit is contained in:
parent
c8133318b8
commit
80cc538e77
@ -88,32 +88,28 @@ RSpec.describe HashtagsController do
|
|||||||
get "/hashtags/by-ids.json", params: { category: [category.id, private_category.id, -1] }
|
get "/hashtags/by-ids.json", params: { category: [category.id, private_category.id, -1] }
|
||||||
|
|
||||||
expect(response.status).to eq(200)
|
expect(response.status).to eq(200)
|
||||||
expect(response.parsed_body).to eq(
|
expect(response.parsed_body["category"]).to contain_exactly(
|
||||||
{
|
{
|
||||||
"category" => [
|
"relative_url" => category.url,
|
||||||
{
|
"text" => category.name,
|
||||||
"relative_url" => category.url,
|
"description" => nil,
|
||||||
"text" => category.name,
|
"colors" => [category.color],
|
||||||
"description" => nil,
|
"icon" => "folder",
|
||||||
"colors" => [category.color],
|
"type" => "category",
|
||||||
"icon" => "folder",
|
"ref" => category.slug,
|
||||||
"type" => "category",
|
"slug" => category.slug,
|
||||||
"ref" => category.slug,
|
"id" => category.id,
|
||||||
"slug" => category.slug,
|
},
|
||||||
"id" => category.id,
|
{
|
||||||
},
|
"relative_url" => private_category.url,
|
||||||
{
|
"text" => private_category.name,
|
||||||
"relative_url" => private_category.url,
|
"description" => nil,
|
||||||
"text" => private_category.name,
|
"colors" => [private_category.color],
|
||||||
"description" => nil,
|
"icon" => "folder",
|
||||||
"colors" => [private_category.color],
|
"type" => "category",
|
||||||
"icon" => "folder",
|
"ref" => private_category.slug,
|
||||||
"type" => "category",
|
"slug" => private_category.slug,
|
||||||
"ref" => private_category.slug,
|
"id" => private_category.id,
|
||||||
"slug" => private_category.slug,
|
|
||||||
"id" => private_category.id,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user