File tree 1 file changed +40
-0
lines changed
1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -1250,6 +1250,46 @@ defmodule AshPostgres.MigrationGeneratorTest do
1250
1250
end
1251
1251
end
1252
1252
1253
+ describe "--dev option" do
1254
+ setup do
1255
+ defposts do
1256
+ attributes do
1257
+ uuid_primary_key ( :id )
1258
+ attribute ( :title , :string , public?: true )
1259
+ end
1260
+ end
1261
+
1262
+ defdomain ( [ Post ] )
1263
+
1264
+ [ domain: Domain ]
1265
+ end
1266
+
1267
+ test "generates dev migration" , % { domain: domain } do
1268
+ AshPostgres.MigrationGenerator . generate ( domain ,
1269
+ snapshot_path: "test_snapshots_path" ,
1270
+ migration_path: "test_migration_path" ,
1271
+ dev: true
1272
+ )
1273
+
1274
+ assert [ file ] =
1275
+ Path . wildcard ( "test_migration_path/**/*_migrate_resources*.exs" )
1276
+ |> Enum . reject ( & String . contains? ( & 1 , "extensions" ) )
1277
+
1278
+ assert String . contains? ( file , "_dev.exs" )
1279
+
1280
+ AshPostgres.MigrationGenerator . generate ( domain ,
1281
+ snapshot_path: "test_snapshots_path" ,
1282
+ migration_path: "test_migration_path"
1283
+ )
1284
+
1285
+ assert [ file ] =
1286
+ Path . wildcard ( "test_migration_path/**/*_migrate_resources*.exs" )
1287
+ |> Enum . reject ( & String . contains? ( & 1 , "extensions" ) )
1288
+
1289
+ refute String . contains? ( file , "_dev.exs" )
1290
+ end
1291
+ end
1292
+
1253
1293
describe "references" do
1254
1294
setup do
1255
1295
on_exit ( fn ->
You can’t perform that action at this time.
0 commit comments