mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
work in progress, add fidelity to category group permissions (full, create posts, readonly)
This commit is contained in:
16
spec/models/site_spec.rb
Normal file
16
spec/models/site_spec.rb
Normal file
@ -0,0 +1,16 @@
|
||||
require 'spec_helper'
|
||||
require_dependency 'site'
|
||||
|
||||
describe Site do
|
||||
it "omits categories users can not write to from the category list" do
|
||||
category = Fabricate(:category)
|
||||
user = Fabricate(:user)
|
||||
|
||||
Site.new(Guardian.new(user)).categories.count.should == 1
|
||||
|
||||
category.set_permissions(:everyone => :create_post)
|
||||
category.save
|
||||
|
||||
Site.new(Guardian.new(user)).categories.count.should == 0
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user