2013-07-13 20:24:16 -05:00
|
|
|
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
|
|
|
|
|
2013-07-16 00:44:07 -05:00
|
|
|
# TODO clean up querying so we can make sure we have the correct permission set
|
|
|
|
Site.new(Guardian.new(user)).categories[0].permission.should_not == CategoryGroup.permission_types[:full]
|
2013-07-13 20:24:16 -05:00
|
|
|
end
|
|
|
|
end
|