diff options
author | Robert Speicher <robert@gitlab.com> | 2017-09-15 21:38:16 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2017-09-15 23:22:36 +0300 |
commit | f2fb4bcb3d5de5650958afb591788d8e073d0ad3 (patch) | |
tree | 27609d3f11298d637ffcbb0231addd33602d4984 /spec | |
parent | ad683011465ff836fd506839db019e040cc661ae (diff) |
Merge branch 'fix-share-with-group-lock-update' into 'master'
Fix setting share_with_group_lock
Closes #37916
See merge request gitlab-org/gitlab-ce!14300
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/group_hierarchy_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/lib/gitlab/group_hierarchy_spec.rb b/spec/lib/gitlab/group_hierarchy_spec.rb index 08010c2d0e2..8dc83a6db7f 100644 --- a/spec/lib/gitlab/group_hierarchy_spec.rb +++ b/spec/lib/gitlab/group_hierarchy_spec.rb @@ -23,6 +23,11 @@ describe Gitlab::GroupHierarchy, :postgresql do expect(relation).to include(parent, child1, child2) end + + it 'does not allow the use of #update_all' do + expect { relation.update_all(share_with_group_lock: false) } + .to raise_error(ActiveRecord::ReadOnlyRecord) + end end describe '#base_and_descendants' do @@ -43,6 +48,11 @@ describe Gitlab::GroupHierarchy, :postgresql do expect(relation).to include(parent, child1, child2) end + + it 'does not allow the use of #update_all' do + expect { relation.update_all(share_with_group_lock: false) } + .to raise_error(ActiveRecord::ReadOnlyRecord) + end end describe '#all_groups' do @@ -73,5 +83,10 @@ describe Gitlab::GroupHierarchy, :postgresql do expect(relation).to include(child2) end + + it 'does not allow the use of #update_all' do + expect { relation.update_all(share_with_group_lock: false) } + .to raise_error(ActiveRecord::ReadOnlyRecord) + end end end |