Merge pull request #4447 from pmusaraj/approve_new_topics_setting

FEATURE: add "Approve new topics unless user level" setting
This commit is contained in:
Sam
2016-10-11 10:14:28 +11:00
committed by GitHub
4 changed files with 31 additions and 0 deletions

View File

@@ -115,6 +115,31 @@ describe NewPostManager do
end
end
context 'with a high trust level setting for new topics but post responds to existing topic' do
before do
SiteSetting.approve_new_topics_unless_trust_level = 4
end
it "doesn't return a result action" do
result = NewPostManager.default_handler(manager)
expect(result).to eq(nil)
end
end
end
context "new topic handler" do
let(:manager) { NewPostManager.new(topic.user, raw: 'this is new topic content', title: 'new topic title') }
context 'with a high trust level setting for new topics' do
before do
SiteSetting.approve_new_topics_unless_trust_level = 4
end
it "will return an enqueue result" do
result = NewPostManager.default_handler(manager)
expect(NewPostManager.queue_enabled?).to eq(true)
expect(result.action).to eq(:enqueued)
end
end
end
context "extensibility priority" do