mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-05 02:10:13 +00:00
28 lines
812 B
Ruby
28 lines
812 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'rails_helper'
|
|
require 'rails/generators/testing/behavior'
|
|
require 'rails/generators/testing/assertions'
|
|
|
|
require 'generators/post_deployment_migration/post_deployment_migration_generator'
|
|
|
|
RSpec.describe PostDeploymentMigrationGenerator, type: :generator do
|
|
include Rails::Generators::Testing::Behavior
|
|
include Rails::Generators::Testing::Assertions
|
|
include FileUtils
|
|
|
|
tests described_class
|
|
destination Rails.root.join('tmp', 'generator-test')
|
|
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
|