diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-05-22 23:40:43 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-05-22 23:40:43 +0300 |
commit | 13bf612600f126faddb4de5e8376a27a466ff830 (patch) | |
tree | 4f0fc27a091a15a776866d5ab96f394d6e75b12e /spec/lib | |
parent | 529c5821305cf152770e5cb762adc5ee2c0143b8 (diff) |
Test migration helpers using a migration class
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/gitlab/database/migration_helpers_spec.rb | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/spec/lib/gitlab/database/migration_helpers_spec.rb b/spec/lib/gitlab/database/migration_helpers_spec.rb index ec43165bb53..642954f8d2d 100644 --- a/spec/lib/gitlab/database/migration_helpers_spec.rb +++ b/spec/lib/gitlab/database/migration_helpers_spec.rb @@ -2,15 +2,13 @@ require 'spec_helper' describe Gitlab::Database::MigrationHelpers, lib: true do let(:model) do - Class.new do - include Gitlab::Database::MigrationHelpers - - def method_missing(name, *args, &block) - ActiveRecord::Base.connection.send(name, *args, &block) - end - end.new + ActiveRecord::Migration.new.extend( + Gitlab::Database::MigrationHelpers + ) end + before { allow(model).to receive(:puts) } + describe '#add_concurrent_index' do context 'outside a transaction' do before do |