From 1245cccf689b7ac47f36097c3d2350a411743921 Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Wed, 6 Sep 2017 11:36:22 +0100 Subject: [PATCH] Use `table` helper in migration specs --- .../migrate_events_to_push_event_payloads_spec.rb | 1 + .../convert_custom_notification_settings_to_columns_spec.rb | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/spec/lib/gitlab/background_migration/migrate_events_to_push_event_payloads_spec.rb b/spec/lib/gitlab/background_migration/migrate_events_to_push_event_payloads_spec.rb index f718339ca12..71141e38b5d 100644 --- a/spec/lib/gitlab/background_migration/migrate_events_to_push_event_payloads_spec.rb +++ b/spec/lib/gitlab/background_migration/migrate_events_to_push_event_payloads_spec.rb @@ -222,6 +222,7 @@ describe Gitlab::BackgroundMigration::MigrateEventsToPushEventPayloads, :migrati end let(:migration) { described_class.new } + let(:user_class) { table(:users) } let(:author) { build(:user).becomes(user_class).tap(&:save!).becomes(User) } let(:namespace) { create(:namespace, owner: author) } let(:project) { create(:project_empty_repo, namespace: namespace, creator: author) } diff --git a/spec/migrations/convert_custom_notification_settings_to_columns_spec.rb b/spec/migrations/convert_custom_notification_settings_to_columns_spec.rb index 02312ddbf8a..759e77ac9db 100644 --- a/spec/migrations/convert_custom_notification_settings_to_columns_spec.rb +++ b/spec/migrations/convert_custom_notification_settings_to_columns_spec.rb @@ -2,11 +2,7 @@ require 'spec_helper' require Rails.root.join('db', 'post_migrate', '20170607121233_convert_custom_notification_settings_to_columns') describe ConvertCustomNotificationSettingsToColumns, :migration do - let(:user_class) do - Class.new(ActiveRecord::Base) do - self.table_name = 'users' - end - end + let(:user_class) { table(:users) } let(:settings_params) do [