A platform for community discussion. Free, open, simple.
Fix random spec errors
Gerhard Schlager558914b98672
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rbindex a30a34b8f15..1cf32c8ead1 100644--- a/app/controllers/groups_controller.rb+++ b/app/controllers/groups_controller.rb@@ -253,7 +253,7 @@ class GroupsController < ApplicationControllerif (usernames = group.users.where(id: users.pluck(:id)).pluck(:username)).present?render_json_error(I18n.t("groups.errors.member_already_exist",- username: usernames.join(", "),+ username: usernames.sort.join(", "),count: usernames.size))elsediff --git a/spec/requests/groups_controller_spec.rb b/spec/requests/groups_controller_spec.rbindex 9532b927772..5e47f4d95c5 100644--- a/spec/requests/groups_controller_spec.rb+++ b/spec/requests/groups_controller_spec.rb@@ -589,7 +589,8 @@ describe GroupsController doendit 'fails when multiple member already exists' do- user3 = Fabricate(:user)+ user2.update!(username: 'alice')+ user3 = Fabricate(:user, username: 'bob')[user2, user3].each { |user| group.add(user) }expect do@@ -601,7 +602,7 @@ describe GroupsController doexpect(JSON.parse(response.body)["errors"]).to include(I18n.t("groups.errors.member_already_exist",- username: "#{user2.username}, #{user3.username}",+ username: "alice, bob",count: 2))end