diff options
author | Sean McGivern <sean@gitlab.com> | 2019-03-12 13:27:54 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2019-03-12 17:09:30 +0300 |
commit | d81597e0c611c013213d3c24d39c330bf18aa057 (patch) | |
tree | c7e74b457ccf293c8e8ac8820ae07f8593ef9fab /spec/migrations | |
parent | b0668b3418bab7d280f0467f26a0fe6a441b3da5 (diff) |
Remove factories from IssuesMovedToIdForeignKey spec
Diffstat (limited to 'spec/migrations')
-rw-r--r-- | spec/migrations/issues_moved_to_id_foreign_key_spec.rb | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/spec/migrations/issues_moved_to_id_foreign_key_spec.rb b/spec/migrations/issues_moved_to_id_foreign_key_spec.rb index 495e86ee888..71a4e71ac8a 100644 --- a/spec/migrations/issues_moved_to_id_foreign_key_spec.rb +++ b/spec/migrations/issues_moved_to_id_foreign_key_spec.rb @@ -1,20 +1,19 @@ require 'spec_helper' require Rails.root.join('db', 'migrate', '20171106151218_issues_moved_to_id_foreign_key.rb') -# The schema version has to be far enough in advance to have the -# only_mirror_protected_branches column in the projects table to create a -# project via FactoryBot. -describe IssuesMovedToIdForeignKey, :migration, schema: 20171114150259 do - let!(:issue_first) { create(:issue, moved_to_id: issue_second.id) } # rubocop:disable RSpec/FactoriesInMigrationSpecs - let!(:issue_second) { create(:issue, moved_to_id: issue_third.id) } # rubocop:disable RSpec/FactoriesInMigrationSpecs - let!(:issue_third) { create(:issue) } # rubocop:disable RSpec/FactoriesInMigrationSpecs +describe IssuesMovedToIdForeignKey, :migration do + let(:issues) { table(:issues) } + + let!(:issue_third) { issues.create! } + let!(:issue_second) { issues.create!(moved_to_id: issue_third.id) } + let!(:issue_first) { issues.create!(moved_to_id: issue_second.id) } subject { described_class.new } it 'removes the orphaned moved_to_id' do subject.down - issue_third.update(moved_to_id: 100000) + issue_third.update!(moved_to_id: 0) subject.up |