FIX: Posting without bump raised an error for TL4

This commit is contained in:
Gerhard Schlager 2019-01-03 14:13:36 +01:00
parent 4aa3992757
commit b089ac1537
2 changed files with 10 additions and 2 deletions

View File

@ -267,6 +267,6 @@ module PostGuardian
end
def can_skip_bump?
is_staff?
is_staff? || @user.has_trust_level?(TrustLevel[4])
end
end

View File

@ -1160,10 +1160,18 @@ describe PostsController do
include_examples "it works"
end
context "TL4 users" do
before do
sign_in(Fabricate(:trust_level_4))
end
include_examples "it works"
end
context "users" do
let(:topic) { Fabricate(:topic) }
[:user, :trust_level_4].each do |user|
[:user].each do |user|
it "will raise an error for #{user}" do
sign_in(Fabricate(user))
post "/posts.json", params: {