aboutsummaryrefslogtreecommitdiffstats
path: root/spec/active_relation/unit/relations/update_spec.rb
diff options
context:
space:
mode:
authorNick Kallen <nkallen@nick-kallens-computer-2.local>2008-04-13 18:49:04 -0700
committerNick Kallen <nkallen@nick-kallens-computer-2.local>2008-04-13 18:49:04 -0700
commit84507c03f49092387b6c57129d350bc5c8463b40 (patch)
treead9dfb7e883b818b525db230bbecca71fc3bf0dc /spec/active_relation/unit/relations/update_spec.rb
parent04c8e48311231d0b8332a7050a48defc9d7b075e (diff)
parent968271f718929311797342e211f5ca29506463b9 (diff)
downloadrails-84507c03f49092387b6c57129d350bc5c8463b40.tar.gz
rails-84507c03f49092387b6c57129d350bc5c8463b40.tar.bz2
rails-84507c03f49092387b6c57129d350bc5c8463b40.zip
Merge branch 'master' of git://github.com/brynary/arel into brynary/master
Diffstat (limited to 'spec/active_relation/unit/relations/update_spec.rb')
-rw-r--r--spec/active_relation/unit/relations/update_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/active_relation/unit/relations/update_spec.rb b/spec/active_relation/unit/relations/update_spec.rb
index 5c234fe759..6634dc67d1 100644
--- a/spec/active_relation/unit/relations/update_spec.rb
+++ b/spec/active_relation/unit/relations/update_spec.rb
@@ -7,6 +7,25 @@ module ActiveRelation
end
describe '#to_sql' do
+ it "manufactures sql updating attributes when given multiple attributes" do
+ pending do
+ Update.new(@relation, @relation[:id] => 1, @relation[:name] => "nick").to_sql.should be_like("
+ UPDATE `users`
+ SET `users`.`name` = 'nick', `users`.`id` = 1
+ ")
+ end
+ end
+
+ it "manufactures sql updating attributes when given a ranged relation" do
+ pending do
+ Update.new(@relation[0..0], @relation[:name] => "nick").to_sql.should be_like("
+ UPDATE `users`
+ SET `users`.`name` = 'nick'
+ LIMIT 1
+ ")
+ end
+ end
+
describe 'when given values whose types correspond to the types of the attributes' do
before do
@update = Update.new(@relation, @relation[:name] => "nick")