Commit 065d4453 authored by Olivier Gonzalez's avatar Olivier Gonzalez

Cleanly handle plural name for ghost user migration

parent 0eb74426
......@@ -49,7 +49,7 @@ module Users
migrate_merge_requests
migrate_notes
migrate_abuse_reports
migrate_award_emojis
migrate_award_emoji
end
def migrate_issues
......@@ -70,7 +70,7 @@ module Users
user.reported_abuse_reports.update_all(reporter_id: ghost_user.id)
end
def migrate_award_emojis
def migrate_award_emoji
user.award_emoji.update_all(user_id: ghost_user.id)
end
end
......
......@@ -86,7 +86,7 @@ shared_examples "migrating a deleted user's associated records to the ghost user
end
it "blocks the user before #{record_class_name} migration begins" do
expect(service).to receive("migrate_#{record_class_name.parameterize('_')}s".to_sym) do
expect(service).to receive("migrate_#{record_class_name.parameterize('_').pluralize}".to_sym) do
expect(user.reload).to be_blocked
end
......
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