diff options
author | Rubén Dávila <ruben@gitlab.com> | 2018-11-27 17:40:14 -0500 |
---|---|---|
committer | Rubén Dávila <ruben@gitlab.com> | 2018-11-27 17:40:14 -0500 |
commit | 34fefa81b7e9427bb542b4997c0d2b7a68b85197 (patch) | |
tree | 3b688a83e0cc1abe7a0c02e1698e0a3514c71e09 /spec/migrations | |
parent | 7bf26235347975d1f450a2da01943a10d8e9f856 (diff) | |
download | gitlab-ce-34fefa81b7e9427bb542b4997c0d2b7a68b85197.tar.gz |
Backport changes from spec/migrations/clean_up_for_members_spec.rb
Diffstat (limited to 'spec/migrations')
-rw-r--r-- | spec/migrations/clean_up_for_members_spec.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/spec/migrations/clean_up_for_members_spec.rb b/spec/migrations/clean_up_for_members_spec.rb index 0258860d169..7876536cb3e 100644 --- a/spec/migrations/clean_up_for_members_spec.rb +++ b/spec/migrations/clean_up_for_members_spec.rb @@ -3,6 +3,7 @@ require Rails.root.join('db', 'migrate', '20171216111734_clean_up_for_members.rb describe CleanUpForMembers, :migration do let(:migration) { described_class.new } + let(:groups) { table(:namespaces) } let!(:group_member) { create_group_member } let!(:unbinded_group_member) { create_group_member } let!(:invited_group_member) { create_group_member(true) } @@ -25,7 +26,7 @@ describe CleanUpForMembers, :migration do end def create_group_member(invited = false) - fill_member(GroupMember.new(group: create_group), invited) + fill_member(GroupMember.new(source_id: create_group.id, source_type: 'Namespace'), invited) end def create_project_member(invited = false) @@ -54,7 +55,7 @@ describe CleanUpForMembers, :migration do def create_group name = FFaker::Lorem.characters(10) - Group.create(name: name, path: name.downcase.gsub(/\s/, '_')) + groups.create!(type: 'Group', name: name, path: name.downcase.gsub(/\s/, '_')) end def create_project |