aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorNick Kallen <nkallen@nick-kallens-computer-2.local>2008-04-13 19:23:23 -0700
committerNick Kallen <nkallen@nick-kallens-computer-2.local>2008-04-13 19:23:23 -0700
commit7a93ce0b1e8560ef5bad7cb7f7a170507bfde16d (patch)
tree86bae7e4179d7264647d63e492f9c8ef71538202 /spec
parent61cdfe916cbe822faff5cd52480c45126bde244e (diff)
downloadrails-7a93ce0b1e8560ef5bad7cb7f7a170507bfde16d.tar.gz
rails-7a93ce0b1e8560ef5bad7cb7f7a170507bfde16d.tar.bz2
rails-7a93ce0b1e8560ef5bad7cb7f7a170507bfde16d.zip
fixed problem with updating multiple values
Diffstat (limited to 'spec')
-rw-r--r--spec/active_relation/unit/relations/deletion_spec.rb2
-rw-r--r--spec/active_relation/unit/relations/update_spec.rb12
2 files changed, 6 insertions, 8 deletions
diff --git a/spec/active_relation/unit/relations/deletion_spec.rb b/spec/active_relation/unit/relations/deletion_spec.rb
index 72f3f81b2a..46a962cb5c 100644
--- a/spec/active_relation/unit/relations/deletion_spec.rb
+++ b/spec/active_relation/unit/relations/deletion_spec.rb
@@ -24,7 +24,7 @@ module ActiveRelation
it "manufactures sql deleting a ranged relation" do
pending do
- Deletion.new(@relation[0..0]).to_sql.should be_like("
+ Deletion.new(@relation.take(1)).to_sql.should be_like("
DELETE
FROM `users`
LIMIT 1
diff --git a/spec/active_relation/unit/relations/update_spec.rb b/spec/active_relation/unit/relations/update_spec.rb
index 6634dc67d1..969b17436f 100644
--- a/spec/active_relation/unit/relations/update_spec.rb
+++ b/spec/active_relation/unit/relations/update_spec.rb
@@ -8,17 +8,15 @@ module ActiveRelation
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
+ Update.new(@relation, @relation[:id] => 1, @relation[:name] => "nick").to_sql.should be_like("
+ UPDATE `users`
+ SET `users`.`id` = 1, `users`.`name` = 'nick'
+ ")
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.new(@relation.take(1), @relation[:name] => "nick").to_sql.should be_like("
UPDATE `users`
SET `users`.`name` = 'nick'
LIMIT 1