diff options
Diffstat (limited to 'spec/arel')
-rw-r--r-- | spec/arel/select_manager_spec.rb | 10 | ||||
-rw-r--r-- | spec/arel/update_manager_spec.rb | 8 |
2 files changed, 18 insertions, 0 deletions
diff --git a/spec/arel/select_manager_spec.rb b/spec/arel/select_manager_spec.rb index 038475bf3d..a728366e0e 100644 --- a/spec/arel/select_manager_spec.rb +++ b/spec/arel/select_manager_spec.rb @@ -24,6 +24,16 @@ module Arel describe 'select manager' do describe 'update' do + it 'takes a string' do + engine = EngineProxy.new Table.engine + table = Table.new :users + manager = Arel::SelectManager.new engine + manager.from table + manager.update('foo = bar') + + engine.executed.last.should be_like %{ UPDATE "users" SET foo = bar } + end + it 'copies where clauses' do engine = EngineProxy.new Table.engine table = Table.new :users diff --git a/spec/arel/update_manager_spec.rb b/spec/arel/update_manager_spec.rb index 9c3789193e..8c4c4f93b8 100644 --- a/spec/arel/update_manager_spec.rb +++ b/spec/arel/update_manager_spec.rb @@ -17,6 +17,14 @@ module Arel um.to_sql.should be_like %{ UPDATE "users" SET "name" = NULL } end + it 'takes a string' do + table = Table.new(:users) + um = Arel::UpdateManager.new Table.engine + um.table table + um.set "foo = bar" + um.to_sql.should be_like %{ UPDATE "users" SET foo = bar } + end + it 'takes a list of lists' do table = Table.new(:users) um = Arel::UpdateManager.new Table.engine |