Sha256: 39673c5a5be42c44d7794efdd3208bcb250b8f3107810a384bd10bab297aad56
Contents?: true
Size: 1.11 KB
Versions: 2
Compression:
Stored size: 1.11 KB
Contents
require "test_helper" require "generators/roomer/migration/migration_generator" class MigrationGeneratorTest < Rails::Generators::TestCase tests Roomer::Generators::MigrationGenerator destination File.expand_path("../../tmp", __FILE__) def setup prepare_destination @use_teananted_migrations = Roomer.use_tenanted_migrations_directory end def teardown Roomer.use_tenanted_migrations_directory = @use_teananted_migrations end test "create migration for a tenanted model" do Roomer.use_tenanted_migrations_directory = false run_generator %w(add_tenant_bar_to_foos bar:string) assert_migration "db/migrate/roomer_add_tenant_bar_to_foos.rb" end test "create migration for a tenanted model in tenant dir" do Roomer.use_tenanted_migrations_directory = true run_generator %w(add_tenant_bar_to_foos bar:string) assert_migration "db/migrate/tenanted/roomer_add_tenant_bar_to_foos.rb" end test "create migration for shared model" do run_generator %w(add_bar_to_foos bar:string --shared) assert_migration "db/migrate/global/roomer_add_bar_to_foos.rb" end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
roomer-1.0.1 | test/generators/migration_generator_test.rb |
roomer-1.0.0 | test/generators/migration_generator_test.rb |