diff options
author | Bryan Helmkamp <bryan@brynary.com> | 2009-05-17 17:53:40 -0400 |
---|---|---|
committer | Bryan Helmkamp <bryan@brynary.com> | 2009-05-17 17:53:40 -0400 |
commit | d2988420fc6dd91ca751d96ed648fd1ed52ce342 (patch) | |
tree | e817b2dcc2b8d018181fd676feb1648786d23de3 /spec/arel/engines/sql/unit/relations/update_spec.rb | |
parent | 7fc820501ce7b997da43c47ec189aaa0d40645e1 (diff) | |
download | rails-d2988420fc6dd91ca751d96ed648fd1ed52ce342.tar.gz rails-d2988420fc6dd91ca751d96ed648fd1ed52ce342.tar.bz2 rails-d2988420fc6dd91ca751d96ed648fd1ed52ce342.zip |
Added PostgreSQL to build
Diffstat (limited to 'spec/arel/engines/sql/unit/relations/update_spec.rb')
-rw-r--r-- | spec/arel/engines/sql/unit/relations/update_spec.rb | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/spec/arel/engines/sql/unit/relations/update_spec.rb b/spec/arel/engines/sql/unit/relations/update_spec.rb index f553490ef5..4d728eb241 100644 --- a/spec/arel/engines/sql/unit/relations/update_spec.rb +++ b/spec/arel/engines/sql/unit/relations/update_spec.rb @@ -17,12 +17,19 @@ module Arel }) end - adapter_is_not :mysql do + adapter_is :sqlite3 do sql.should be_like(%Q{ UPDATE "users" SET "id" = 1, "name" = 'nick' }) end + + adapter_is :postgresql do + sql.should be_like(%Q{ + UPDATE "users" + SET "id" = 1, "name" = E'nick' + }) + end end it "manufactures sql updating attributes when given a ranged relation" do @@ -36,13 +43,21 @@ module Arel }) end - adapter_is_not :mysql do + adapter_is :sqlite3 do sql.should be_like(%Q{ UPDATE "users" SET "name" = 'nick' LIMIT 1 }) end + + adapter_is :postgresql do + sql.should be_like(%Q{ + UPDATE "users" + SET "name" = E'nick' + LIMIT 1 + }) + end end describe 'when given values whose types correspond to the types of the attributes' do @@ -58,12 +73,19 @@ module Arel }) end - adapter_is_not :mysql do + adapter_is :sqlite3 do @update.to_sql.should be_like(%Q{ UPDATE "users" SET "name" = 'nick' }) end + + adapter_is :postgresql do + @update.to_sql.should be_like(%Q{ + UPDATE "users" + SET "name" = E'nick' + }) + end end end @@ -106,13 +128,21 @@ module Arel }) end - adapter_is_not :mysql do + adapter_is :sqlite3 do @update.to_sql.should be_like(%Q{ UPDATE "users" SET "name" = 'nick' WHERE "users"."id" = 1 }) end + + adapter_is :postgresql do + @update.to_sql.should be_like(%Q{ + UPDATE "users" + SET "name" = E'nick' + WHERE "users"."id" = 1 + }) + end end end end |