mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 15:48:43 -05:00
666264879c
this cleans up a bunch of internals and removes some settings
21 lines
547 B
Ruby
21 lines
547 B
Ruby
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 == 2
|
|
|
|
category.set_permissions(:everyone => :create_post)
|
|
category.save
|
|
|
|
Site.new(Guardian.new(user))
|
|
.categories
|
|
.keep_if{|c| c.name == category.name}
|
|
.first
|
|
.permission
|
|
.should_not == CategoryGroup.permission_types[:full]
|
|
end
|
|
end
|