We only need to mention buckets if scoped
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user