spec/arel/engines/sql/unit/relations/table_spec.rb in arel-0.2.1 vs spec/arel/engines/sql/unit/relations/table_spec.rb in arel-0.3.0

- old
+ new

@@ -15,12 +15,19 @@ SELECT `users`.`id`, `users`.`name` FROM `users` }) end - adapter_is_not :mysql do + adapter_is :oracle do sql.should be_like(%Q{ + SELECT "USERS"."ID", "USERS"."NAME" + FROM "USERS" + }) + end + + adapter_is_not :mysql, :oracle do + sql.should be_like(%Q{ SELECT "users"."id", "users"."name" FROM "users" }) end end @@ -31,18 +38,25 @@ sql = @relation.as(:super_users).to_sql adapter_is :mysql do sql.should be_like(%Q{ SELECT `super_users`.`id`, `super_users`.`name` - FROM `users` AS `super_users` + FROM `users` `super_users` }) end - adapter_is_not :mysql do + adapter_is :oracle do sql.should be_like(%Q{ + SELECT "SUPER_USERS"."ID", "SUPER_USERS"."NAME" + FROM "USERS" "SUPER_USERS" + }) + end + + adapter_is_not :mysql, :oracle do + sql.should be_like(%Q{ SELECT "super_users"."id", "super_users"."name" - FROM "users" AS "super_users" + FROM "users" "super_users" }) end end it "does not apply alias if it's same as the table name" do @@ -53,10 +67,17 @@ SELECT `users`.`id`, `users`.`name` FROM `users` }) end - adapter_is_not :mysql do + adapter_is :oracle do + sql.should be_like(%Q{ + SELECT "USERS"."ID", "USERS"."NAME" + FROM "USERS" + }) + end + + adapter_is_not :mysql, :oracle do sql.should be_like(%Q{ SELECT "users"."id", "users"."name" FROM "users" }) end