SECURITY HOLE, upgrade right away if you are using Secure Groups.

This commit is contained in:
Sam
2013-06-08 23:52:06 +10:00
parent 7a73afa117
commit 1756f713d6
2 changed files with 28 additions and 0 deletions

View File

@ -1218,6 +1218,20 @@ describe Topic do
end
end
describe 'secured' do
it 'can remove secure groups' do
category = Fabricate(:category, secure: true)
topic = Fabricate(:topic, category: category)
Topic.secured(Guardian.new(nil)).count.should == 0
Topic.secured(Guardian.new(Fabricate(:admin))).count.should == 2
# for_digest
Topic.for_digest(Fabricate(:user), 1.year.ago).count.should == 0
end
end
describe '#secure_category?' do
let(:category){ Category.new }