mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: flaky post action counts specs (#27165)
After flags were moved to the database, with each save they are changing available PostActionTypes. Therefore, flag specs should clear the state before and after each example not just before. In addition, we need to clear `nil` counts for dynamically created flags from serializer.
This commit is contained in:
committed by
GitHub
parent
3a3ee5e04a
commit
a4c5f85b10
@@ -331,7 +331,7 @@ class PostSerializer < BasicPostSerializer
|
||||
summary[:count] = summary[:acted] ? 1 : 0
|
||||
end
|
||||
|
||||
summary.delete(:count) if summary[:count] == 0
|
||||
summary.delete(:count) if summary[:count].to_i.zero?
|
||||
|
||||
# Only include it if the user can do it or it has a count
|
||||
result << summary if summary[:can_act] || summary[:count]
|
||||
|
||||
Reference in New Issue
Block a user