diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2017-02-07 16:55:42 +0300 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2017-02-07 16:58:49 +0300 |
commit | ebae38394d8d6738ace1719633ad93c112951f03 (patch) | |
tree | ba256bac5a04def9aea317706feea4ae65b36c1c /spec/models/group_spec.rb | |
parent | 99fceff4f9e98cc7cb725882abec6e5b7c9b0170 (diff) |
Refresh authorizations when transferring projects
This ensures that project authorizations are refreshed when moving a
project from one namespace to another. When doing so the permissions for
all users of both the old and new namespaces are refreshed.
See #26194 for more information.
Diffstat (limited to 'spec/models/group_spec.rb')
-rw-r--r-- | spec/models/group_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/models/group_spec.rb b/spec/models/group_spec.rb index 9ca50555191..a4e6eb4e3a6 100644 --- a/spec/models/group_spec.rb +++ b/spec/models/group_spec.rb @@ -300,4 +300,17 @@ describe Group, models: true do expect(group.members_with_parents).to include(master) end end + + describe '#user_ids_for_project_authorizations' do + it 'returns the user IDs for which to refresh authorizations' do + master = create(:user) + developer = create(:user) + + group.add_user(master, GroupMember::MASTER) + group.add_user(developer, GroupMember::DEVELOPER) + + expect(group.user_ids_for_project_authorizations). + to include(master.id, developer.id) + end + end end |