Skip to content

Commit

Permalink
Add test for multiple table changes at once.
Browse files Browse the repository at this point in the history
  • Loading branch information
elpete committed Sep 22, 2017
1 parent a54eb86 commit cf65e11
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions tests/specs/Schema/SchemaBuilder+GrammarSpec.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,7 @@ component extends="testbox.system.BaseSpec" {
} );
} );

xit( "can drop and add and rename and modify columns at the same time", function() {
it( "can drop and add and rename and modify columns at the same time", function() {
var schema = getBuilder();
var blueprint = schema.alter( "users", function( table ) {
table.dropColumn( "is_active" );
Expand All @@ -734,9 +734,9 @@ component extends="testbox.system.BaseSpec" {
expect( statements ).toBeArray();
expect( statements ).toHaveLength( 4 );
expect( statements[ 1 ] ).toBeWithCase( "ALTER TABLE ""users"" DROP COLUMN ""is_active""" );
expect( statements[ 2 ] ).toBeWithCase( "ALTER TABLE ""users"" ADD COLUMN ""tshirt_size"" ENUM(""S"",""M"",""L"",""XL"",""XXL"") NOT NULL" );
expect( statements[ 2 ] ).toBeWithCase( "ALTER TABLE ""users"" ADD ""tshirt_size"" ENUM(""S"",""M"",""L"",""XL"",""XXL"") NOT NULL" );
expect( statements[ 3 ] ).toBeWithCase( "ALTER TABLE ""users"" CHANGE ""name"" ""username"" VARCHAR(255) NOT NULL" );
expect( statements[ 4 ] ).toBeWithCase( "ALTER TABLE ""users"" CHANGE ""purchase_date"" ""purchased_at"" TIMESTAMP" );
expect( statements[ 4 ] ).toBeWithCase( "ALTER TABLE ""users"" CHANGE ""purchase_date"" ""purchase_date"" TIMESTAMP" );
} );

describe( "drop", function() {
Expand Down
4 changes: 2 additions & 2 deletions tests/specs/Schema/SchemaBuilder+MySQLGrammarSpec.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ component extends="testbox.system.BaseSpec" {
} );
} );

xit( "can drop and add and rename and modify columns at the same time", function() {
it( "can drop and add and rename and modify columns at the same time", function() {
var schema = getBuilder();
var blueprint = schema.alter( "users", function( table ) {
table.dropColumn( "is_active" );
Expand All @@ -79,7 +79,7 @@ component extends="testbox.system.BaseSpec" {
expect( statements[ 1 ] ).toBeWithCase( "ALTER TABLE `users` DROP COLUMN `is_active`" );
expect( statements[ 2 ] ).toBeWithCase( "ALTER TABLE `users` ADD `tshirt_size` ENUM(`S`,`M`,`L`,`XL`,`XXL`) NOT NULL" );
expect( statements[ 3 ] ).toBeWithCase( "ALTER TABLE `users` CHANGE `name` `username` VARCHAR(255) NOT NULL" );
expect( statements[ 4 ] ).toBeWithCase( "ALTER TABLE `users` CHANGE `purchase_date` `purchased_at` TIMESTAMP" );
expect( statements[ 4 ] ).toBeWithCase( "ALTER TABLE `users` CHANGE `purchase_date` `purchase_date` TIMESTAMP" );
} );
} );
}
Expand Down
8 changes: 4 additions & 4 deletions tests/specs/Schema/SchemaBuilder+OracleGrammarSpec.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ component extends="testbox.system.BaseSpec" {
} );
} );

xit( "can drop and add and rename and modify columns at the same time", function() {
it( "can drop and add and rename and modify columns at the same time", function() {
var schema = getBuilder();
var blueprint = schema.alter( "users", function( table ) {
table.dropColumn( "is_active" );
Expand All @@ -104,10 +104,10 @@ component extends="testbox.system.BaseSpec" {
var statements = blueprint.toSql();
expect( statements ).toBeArray();
expect( statements ).toHaveLength( 4 );
expect( statements[ 1 ] ).toBeWithCase( "ALTER TABLE ""users"" DROP COLUMN ""is_active""" );
expect( statements[ 1 ] ).toBeWithCase( "ALTER TABLE ""USERS"" DROP COLUMN ""IS_ACTIVE""" );
expect( statements[ 2 ] ).toBeWithCase( "ALTER TABLE ""USERS"" ADD ""TSHIRT_SIZE"" VARCHAR(255) CHECK(""TSHIRT_SIZE"" IN (""S"",""M"",""L"",""XL"",""XXL"")) NOT NULL" );
expect( statements[ 3 ] ).toBeWithCase( "ALTER TABLE ""users"" RENAME COLUMN ""name"" TO ""username""" );
expect( statements[ 4 ] ).toBeWithCase( "ALTER TABLE ""users"" MODIFY ""purchase_date"" TIMESTAMP" );
expect( statements[ 3 ] ).toBeWithCase( "ALTER TABLE ""USERS"" RENAME COLUMN ""NAME"" TO ""USERNAME""" );
expect( statements[ 4 ] ).toBeWithCase( "ALTER TABLE ""USERS"" MODIFY ""PURCHASE_DATE"" TIMESTAMP" );
} );
} );
}
Expand Down

0 comments on commit cf65e11

Please sign in to comment.