mirror of
https://github.com/discourse/discourse.git
synced 2026-09-05 04:40:41 -05:00
Correct site spec
This commit is contained in:
+1
-1
@@ -29,7 +29,7 @@ class Site
|
||||
@categories ||= begin
|
||||
categories = Category
|
||||
.secured(@guardian)
|
||||
.joins('JOIN topics t on t.id = categories.topic_id')
|
||||
.joins('LEFT JOIN topics t on t.id = categories.topic_id')
|
||||
.select('categories.*, t.slug topic_slug')
|
||||
.order(:position)
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@ require_dependency 'site'
|
||||
|
||||
describe Site do
|
||||
it "omits categories users can not write to from the category list" do
|
||||
|
||||
ActiveRecord::Base.observers.enable :anon_site_json_cache_observer
|
||||
|
||||
category = Fabricate(:category)
|
||||
user = Fabricate(:user)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user