mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 00:37:44 +08:00
Revert "FEATURE: Can create warnings for users via PM"
This reverts commit b0bfc1f93f18b19143a59eafd6d8d2e84a872dcc.
This commit is contained in:
@ -384,7 +384,6 @@ describe PostsController do
|
||||
describe 'when logged in' do
|
||||
|
||||
let!(:user) { log_in }
|
||||
let(:moderator) { log_in(:moderator) }
|
||||
let(:new_post) { Fabricate.build(:post, user: user) }
|
||||
|
||||
it "raises an exception without a raw parameter" do
|
||||
@ -493,24 +492,6 @@ describe PostsController do
|
||||
xhr :post, :create, {raw: 'hello', meta_data: {xyz: 'abc'}}
|
||||
end
|
||||
|
||||
context "is_warning" do
|
||||
it "doesn't pass `is_warning` through if you're not staff" do
|
||||
PostCreator.expects(:new).with(user, Not(has_entries('is_warning' => true))).returns(post_creator)
|
||||
xhr :post, :create, {raw: 'hello', archetype: 'private_message', is_warning: 'true'}
|
||||
end
|
||||
|
||||
it "passes `is_warning` through if you're staff" do
|
||||
PostCreator.expects(:new).with(moderator, has_entries('is_warning' => true)).returns(post_creator)
|
||||
xhr :post, :create, {raw: 'hello', archetype: 'private_message', is_warning: 'true'}
|
||||
end
|
||||
|
||||
it "passes `is_warning` as false through if you're staff" do
|
||||
PostCreator.expects(:new).with(moderator, has_entries('is_warning' => false)).returns(post_creator)
|
||||
xhr :post, :create, {raw: 'hello', archetype: 'private_message', is_warning: 'false'}
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user