mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
FEATURE: Category setting to make all topics wikis
FEATURE: Category setting to make all topics wikis
This commit is contained in:
@ -34,6 +34,14 @@ describe PostCreator do
|
||||
expect(TopicUser.where(user_id: p.user_id, topic_id: p.topic_id).count).to eq(0)
|
||||
end
|
||||
|
||||
it "can be created with first post as wiki" do
|
||||
cat = Fabricate(:category)
|
||||
cat.all_topics_wiki = true
|
||||
cat.save
|
||||
post = PostCreator.create(user, basic_topic_params.merge(category: cat.id ))
|
||||
expect(post.wiki).to eq(true)
|
||||
end
|
||||
|
||||
it "ensures the user can create the topic" do
|
||||
Guardian.any_instance.expects(:can_create?).with(Topic,nil).returns(false)
|
||||
expect { creator.create }.to raise_error(Discourse::InvalidAccess)
|
||||
|
Reference in New Issue
Block a user