Sort the group count values to fix tests in PgSQL broken by 5b6cbf566.

This commit is contained in:
Jyri-Petteri Paloposki 2020-09-05 02:40:26 +03:00
parent bbb9fc8809
commit 41c9d3fb18

View file

@ -364,16 +364,16 @@ class UserTest < ActiveSupport::TestCase
# test group counts for projects and contexts # test group counts for projects and contexts
project_counts = u.todos.count_by_group(:project_id) project_counts = u.todos.count_by_group(:project_id)
assert_equal [6,3,4,4], project_counts.values assert_equal [6,3,4,4].sort, project_counts.values.sort
context_counts = u.todos.count_by_group(:context_id) context_counts = u.todos.count_by_group(:context_id)
assert_equal [7,3,1,3,1,2], context_counts.values assert_equal [7,3,1,3,1,2].sort, context_counts.values.sort
# add a todo to the first context and check that the count is increased # add a todo to the first context and check that the count is increased
u.todos.create!(:description => "yet another todo", :context => u.contexts.first) u.todos.create!(:description => "yet another todo", :context => u.contexts.first)
context_counts = u.todos.reload.count_by_group(:context_id) context_counts = u.todos.reload.count_by_group(:context_id)
assert_equal [8,3,1,3,1,2], context_counts.values assert_equal [8,3,1,3,1,2].sort, context_counts.values.sort
end end
def test_deleting_user_deletes_all_related_data def test_deleting_user_deletes_all_related_data