mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 17:04:36 +08:00
FIX: Fixed editing whispers bumps topic (#7106)
This commit is contained in:
parent
671cec4bd2
commit
83f4c4a3f2
|
@ -512,7 +512,7 @@ class PostRevisor
|
||||||
end
|
end
|
||||||
|
|
||||||
def bypass_bump?
|
def bypass_bump?
|
||||||
!@post_successfully_saved || @topic_changes.errored? || @opts[:bypass_bump] == true
|
!@post_successfully_saved || @topic_changes.errored? || @opts[:bypass_bump] == true || @post.whisper?
|
||||||
end
|
end
|
||||||
|
|
||||||
def is_last_post?
|
def is_last_post?
|
||||||
|
|
|
@ -393,6 +393,15 @@ describe PostsController do
|
||||||
post.reload
|
post.reload
|
||||||
expect(post.raw).to eq('edited body')
|
expect(post.raw).to eq('edited body')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "won't update bump date if post is a whisper" do
|
||||||
|
post = Fabricate(:post, post_type: Post.types[:whisper], user: user)
|
||||||
|
|
||||||
|
put "/posts/#{post.id}.json", params: update_params
|
||||||
|
expect(response.status).to eq(200)
|
||||||
|
|
||||||
|
expect(post.topic.reload.bumped_at).to be < post.created_at
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'can not change category to a disallowed category' do
|
it 'can not change category to a disallowed category' do
|
||||||
|
|
Loading…
Reference in New Issue
Block a user