We only need to mention buckets if scoped

This commit is contained in:
Jason Zimdars
2025-02-12 16:18:08 -06:00
parent 7c3c3f6998
commit 08fb92b526
2 changed files with 2 additions and 4 deletions
-2
View File
@@ -37,8 +37,6 @@ module Filter::Summarized
def bucket_summary
if buckets.any?
"in #{buckets.pluck(:name).to_choice_sentence}"
else
"in all collections"
end
end
+2 -2
View File
@@ -103,10 +103,10 @@ class FilterTest < ActiveSupport::TestCase
end
test "summary" do
assert_equal "Most discussed, tagged #Mobile, and assigned to JZ in all collections", filters(:jz_assignments).summary
assert_equal "Most discussed, tagged #Mobile, and assigned to JZ ", filters(:jz_assignments).summary
filters(:jz_assignments).update!(stages: workflow_stages(:qa_triage, :qa_in_progress))
assert_equal "Most discussed, tagged #Mobile, assigned to JZ, and staged in Triage or In Progress in all collections", filters(:jz_assignments).summary
assert_equal "Most discussed, tagged #Mobile, assigned to JZ, and staged in Triage or In Progress ", filters(:jz_assignments).summary
filters(:jz_assignments).update!(stages: [], assignees: [], tags: [], buckets: [ buckets(:writebook) ])
assert_equal "Most discussed in Writebook", filters(:jz_assignments).summary