diff options
author | Claire <claire.github-309c@sitedethib.com> | 2023-04-16 17:52:44 +0200 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2023-04-16 17:52:44 +0200 |
commit | f9a9f9344bd6e1dbe653feaf316abdf51633f587 (patch) | |
tree | ad1fef974e50279b9ffa54b504b9107f3f6f66c0 /spec/generators | |
parent | f28942cef991c9285236ea3ecace98c9b65c5242 (diff) | |
parent | af49d93fd6168c089530240a9ab4eccb975b8c42 (diff) |
Merge branch 'main' into glitch-soc/merge-upstream
Diffstat (limited to 'spec/generators')
-rw-r--r-- | spec/generators/post_deployment_migration_generator_spec.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/generators/post_deployment_migration_generator_spec.rb b/spec/generators/post_deployment_migration_generator_spec.rb new file mode 100644 index 000000000..d552880e3 --- /dev/null +++ b/spec/generators/post_deployment_migration_generator_spec.rb @@ -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 |