0
0
Fork 0

Clean up the post deployment migration generator (#24233)

This commit is contained in:
Matt Jankowski 2023-04-11 11:25:29 +02:00 committed by GitHub
parent 3c7053a2db
commit a2a66300d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 62 additions and 25 deletions

View file

@ -0,0 +1,27 @@
# frozen_string_literal: true
require 'rails_helper'
require 'rails/generators/testing/behaviour'
require 'rails/generators/testing/assertions'
require 'generators/post_deployment_migration/post_deployment_migration_generator'
describe PostDeploymentMigrationGenerator, type: :generator do
include Rails::Generators::Testing::Behaviour
include Rails::Generators::Testing::Assertions
include FileUtils
tests described_class
destination File.expand_path('../../tmp', __dir__)
before { prepare_destination }
after { rm_rf(destination_root) }
describe 'the migration' do
it 'generates expected file' do
run_generator %w(Changes)
assert_migration('db/post_migrate/changes.rb', /disable_ddl/)
assert_migration('db/post_migrate/changes.rb', /change/)
end
end
end