FIX: Suspended users should not be allowed to post

This commit is contained in:
Sam
2014-07-31 13:15:16 +10:00
parent e907cca62e
commit 138d013e56
3 changed files with 25 additions and 3 deletions
+11
View File
@@ -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