Commit 34fefa81 authored by Rubén Dávila's avatar Rubén Dávila

Backport changes from spec/migrations/clean_up_for_members_spec.rb

parent 7bf26235
...@@ -3,6 +3,7 @@ require Rails.root.join('db', 'migrate', '20171216111734_clean_up_for_members.rb ...@@ -3,6 +3,7 @@ require Rails.root.join('db', 'migrate', '20171216111734_clean_up_for_members.rb
describe CleanUpForMembers, :migration do describe CleanUpForMembers, :migration do
let(:migration) { described_class.new } let(:migration) { described_class.new }
let(:groups) { table(:namespaces) }
let!(:group_member) { create_group_member } let!(:group_member) { create_group_member }
let!(:unbinded_group_member) { create_group_member } let!(:unbinded_group_member) { create_group_member }
let!(:invited_group_member) { create_group_member(true) } let!(:invited_group_member) { create_group_member(true) }
...@@ -25,7 +26,7 @@ describe CleanUpForMembers, :migration do ...@@ -25,7 +26,7 @@ describe CleanUpForMembers, :migration do
end end
def create_group_member(invited = false) 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 end
def create_project_member(invited = false) def create_project_member(invited = false)
...@@ -54,7 +55,7 @@ describe CleanUpForMembers, :migration do ...@@ -54,7 +55,7 @@ describe CleanUpForMembers, :migration do
def create_group def create_group
name = FFaker::Lorem.characters(10) 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 end
def create_project def create_project
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment