diff options
author | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-05-13 16:53:36 -0700 |
---|---|---|
committer | Nick Kallen <nkallen@nick-kallens-computer-2.local> | 2008-05-13 16:53:36 -0700 |
commit | 16730fdbd0ab630320aba225314aa6a1a3b450fe (patch) | |
tree | a92ac069bb47e68b3061113c6557ffb72b21071c /spec | |
parent | 562a0bf634bd61f61ebb0145d7626fb484e13c53 (diff) | |
download | rails-16730fdbd0ab630320aba225314aa6a1a3b450fe.tar.gz rails-16730fdbd0ab630320aba225314aa6a1a3b450fe.tar.bz2 rails-16730fdbd0ab630320aba225314aa6a1a3b450fe.zip |
fixed defect in alias
Diffstat (limited to 'spec')
-rw-r--r-- | spec/arel/unit/relations/alias_spec.rb | 11 | ||||
-rw-r--r-- | spec/arel/unit/relations/insertion_spec.rb | 2 | ||||
-rw-r--r-- | spec/arel/unit/relations/update_spec.rb | 2 | ||||
-rw-r--r-- | spec/arel/unit/session/session_spec.rb | 10 |
4 files changed, 13 insertions, 12 deletions
diff --git a/spec/arel/unit/relations/alias_spec.rb b/spec/arel/unit/relations/alias_spec.rb index 25dbf70668..85850b5e1a 100644 --- a/spec/arel/unit/relations/alias_spec.rb +++ b/spec/arel/unit/relations/alias_spec.rb @@ -7,10 +7,19 @@ module Arel end describe '==' do - it "returns the alias" do + it "obtains if the objects are the same" do Alias.new(@relation).should_not == Alias.new(@relation) (aliaz = Alias.new(@relation)).should == aliaz end + + it '' do + @relation.select(@relation[:id].eq(1)).to_sql.should be_like(" + SELECT `users`.`id`, `users`.`name` + FROM `users` + WHERE + `users`.`id` = 1 + ") + end end end end
\ No newline at end of file diff --git a/spec/arel/unit/relations/insertion_spec.rb b/spec/arel/unit/relations/insertion_spec.rb index 0667aa665e..10b70a2036 100644 --- a/spec/arel/unit/relations/insertion_spec.rb +++ b/spec/arel/unit/relations/insertion_spec.rb @@ -24,7 +24,7 @@ module Arel @insertion.to_sql.should be_like(" INSERT INTO `users` - (`users`.`name`, `users`.`id`) VALUES ('nick', 1) + (`users`.`id`, `users`.`name`) VALUES (1, 'nick') ") end diff --git a/spec/arel/unit/relations/update_spec.rb b/spec/arel/unit/relations/update_spec.rb index 976e88dddc..f411781392 100644 --- a/spec/arel/unit/relations/update_spec.rb +++ b/spec/arel/unit/relations/update_spec.rb @@ -10,7 +10,7 @@ module Arel it "manufactures sql updating attributes when given multiple attributes" do Update.new(@relation, @relation[:id] => 1, @relation[:name] => "nick").to_sql.should be_like(" UPDATE `users` - SET `users`.`name` = 'nick', `users`.`id` = 1 + SET `users`.`id` = 1, `users`.`name` = 'nick' ") end diff --git a/spec/arel/unit/session/session_spec.rb b/spec/arel/unit/session/session_spec.rb index c2eb9a4555..fbb2b7791b 100644 --- a/spec/arel/unit/session/session_spec.rb +++ b/spec/arel/unit/session/session_spec.rb @@ -73,20 +73,12 @@ module Arel end end - describe Session::Transactions do + describe 'Transactions' do describe '#begin' do end describe '#end' do end end - - describe Session::UnitOfWork do - describe '#flush' do - end - - describe '#clear' do - end - end end end
\ No newline at end of file |