mirror of
https://github.com/discourse/discourse.git
synced 2025-06-02 04:08:41 +08:00
FIX: Improvements to like button for archived topics (#17951)
* FIX: Do not allow to remove like if topic is archived * FIX: Always show like button The like button used to be hidden if the topic was archived and it had no likes. This commit changes that to always show the like button, but with a not-allowed cursor if the topic is archived.
This commit is contained in:
@ -55,6 +55,14 @@ RSpec.describe PostSerializer do
|
||||
|
||||
expect(notify_user_action).to eq(nil)
|
||||
end
|
||||
|
||||
it "shows like for archived topics even if user cannot act" do
|
||||
post = Fabricate(:post)
|
||||
post.topic.update!(archived: true)
|
||||
|
||||
serializer = PostSerializer.new(post, scope: Guardian.new(actor), root: false)
|
||||
expect(serializer.as_json[:actions_summary].map { |a| a[:id] }).to include(PostActionType.types[:like])
|
||||
end
|
||||
end
|
||||
|
||||
context "with a post with reviewable content" do
|
||||
|
Reference in New Issue
Block a user