mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Add specs for hashtags related code (#18526)
Adding a couple of small specs to code around hashtags for tags and categories since I will be working in this area soon and these were not covered.
This commit is contained in:
@@ -32,6 +32,16 @@ RSpec.describe HashtagsController do
|
||||
)
|
||||
end
|
||||
|
||||
it "handles tags with the TAG_HASHTAG_POSTFIX" do
|
||||
get "/hashtags.json", params: { slugs: ["#{tag.name}#{PrettyText::Helpers::TAG_HASHTAG_POSTFIX}"] }
|
||||
|
||||
expect(response.status).to eq(200)
|
||||
expect(response.parsed_body).to eq(
|
||||
"categories" => {},
|
||||
"tags" => { tag.name => tag.full_url }
|
||||
)
|
||||
end
|
||||
|
||||
it "does not return restricted categories or hidden tags" do
|
||||
get "/hashtags.json", params: { slugs: [private_category.slug, hidden_tag.name] }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user