mirror of
https://github.com/discourse/discourse.git
synced 2026-09-05 04:40:41 -05:00
FIX: Suspended users should not be allowed to post
This commit is contained in:
@@ -463,5 +463,16 @@ describe PostCreator do
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
describe "suspended users" do
|
||||
it "does not allow suspended users to create topics" do
|
||||
user = Fabricate(:user, suspended_at: 1.month.ago, suspended_till: 1.month.from_now)
|
||||
|
||||
creator = PostCreator.new(user, {title: "my test title 123", raw: "I should not be allowed to post"} )
|
||||
creator.create
|
||||
creator.errors.count.should be > 0
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user