Use table helper in migration specs

This commit is contained in:
Sean McGivern 2017-09-06 11:36:22 +01:00 committed by Ruben Davila
parent cd84ce1a1b
commit 1245cccf68
2 changed files with 2 additions and 5 deletions

View file

@ -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) }

View file

@ -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
[