diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-01 06:06:11 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-01 06:06:11 +0000 |
commit | 864475536355651a9f7caa5b1606aa5640424ec3 (patch) | |
tree | 1dc80c96ddf3f9049c4a163b4c49f052a9b1a4ad /spec/lib/gitlab/database | |
parent | 7ddd5846999029916b2b6d8560b5b0f02ec0f6ea (diff) | |
download | gitlab-ce-864475536355651a9f7caa5b1606aa5640424ec3.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/database')
-rw-r--r-- | spec/lib/gitlab/database/obsolete_ignored_columns_spec.rb | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/spec/lib/gitlab/database/obsolete_ignored_columns_spec.rb b/spec/lib/gitlab/database/obsolete_ignored_columns_spec.rb index 6d38f7f1b95..b3826666b18 100644 --- a/spec/lib/gitlab/database/obsolete_ignored_columns_spec.rb +++ b/spec/lib/gitlab/database/obsolete_ignored_columns_spec.rb @@ -8,21 +8,27 @@ describe Gitlab::Database::ObsoleteIgnoredColumns do end class SomeAbstract < MyBase + include IgnorableColumns + self.abstract_class = true self.table_name = 'projects' - self.ignored_columns += %i[unused] + ignore_column :unused, remove_after: '2019-01-01', remove_with: '12.0' end class B < MyBase + include IgnorableColumns + self.table_name = 'issues' - self.ignored_columns += %i[id other] + ignore_column :id, :other, remove_after: '2019-01-01', remove_with: '12.0' + ignore_column :not_used_but_still_ignored, remove_after: Date.today.to_s, remove_with: '12.1' end class A < SomeAbstract - self.ignored_columns += %i[id also_unused] + ignore_column :also_unused, remove_after: '2019-02-01', remove_with: '12.1' + ignore_column :not_used_but_still_ignored, remove_after: Date.today.to_s, remove_with: '12.1' end class C < MyBase @@ -35,8 +41,13 @@ describe Gitlab::Database::ObsoleteIgnoredColumns do describe '#execute' do it 'returns a list of class names and columns pairs' do expect(subject.execute).to eq([ - ['Testing::A', %w(unused also_unused)], - ['Testing::B', %w(other)] + ['Testing::A', { + 'unused' => IgnorableColumns::ColumnIgnore.new(Date.parse('2019-01-01'), '12.0'), + 'also_unused' => IgnorableColumns::ColumnIgnore.new(Date.parse('2019-02-01'), '12.1') + }], + ['Testing::B', { + 'other' => IgnorableColumns::ColumnIgnore.new(Date.parse('2019-01-01'), '12.0') + }] ]) end end |