mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Autolinking to category using hashtags.
This commit is contained in:
@@ -503,6 +503,22 @@ describe Category do
|
||||
end
|
||||
end
|
||||
|
||||
describe "#url_with_id" do
|
||||
let(:category) { Fabricate(:category, name: 'cats') }
|
||||
|
||||
it "includes the id in the URL" do
|
||||
expect(category.url_with_id).to eq("/c/#{category.id}-cats")
|
||||
end
|
||||
|
||||
context "child category" do
|
||||
let(:child_category) { Fabricate(:category, parent_category_id: category.id, name: 'dogs') }
|
||||
|
||||
it "includes the id in the URL" do
|
||||
expect(child_category.url_with_id).to eq("/c/cats/dogs/#{child_category.id}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "uncategorized" do
|
||||
let(:cat) { Category.where(id: SiteSetting.uncategorized_category_id).first }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user