Correct site spec
This commit is contained in:
parent
1061a9ed06
commit
6c37b26b24
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue