aboutsummaryrefslogtreecommitdiffstats
path: root/spec/active_relation/unit/relations/table_spec.rb
diff options
context:
space:
mode:
authorNick Kallen <nkallen@nick-kallens-computer-2.local>2008-03-02 17:05:06 -0800
committerNick Kallen <nkallen@nick-kallens-computer-2.local>2008-03-02 17:05:06 -0800
commit86550ef2bee377a5e4134dc63dedb138bb9ab7dc (patch)
tree50726fc4904437eeb83ab7ad999ced774e253f71 /spec/active_relation/unit/relations/table_spec.rb
parent92db013ba3ee4d0a9d92281e614d05f064c22e15 (diff)
downloadrails-86550ef2bee377a5e4134dc63dedb138bb9ab7dc.tar.gz
rails-86550ef2bee377a5e4134dc63dedb138bb9ab7dc.tar.bz2
rails-86550ef2bee377a5e4134dc63dedb138bb9ab7dc.zip
new concept of session boundaries
Diffstat (limited to 'spec/active_relation/unit/relations/table_spec.rb')
-rw-r--r--spec/active_relation/unit/relations/table_spec.rb14
1 files changed, 11 insertions, 3 deletions
diff --git a/spec/active_relation/unit/relations/table_spec.rb b/spec/active_relation/unit/relations/table_spec.rb
index f8d4431aa7..5c7fa35e63 100644
--- a/spec/active_relation/unit/relations/table_spec.rb
+++ b/spec/active_relation/unit/relations/table_spec.rb
@@ -38,16 +38,16 @@ module ActiveRelation
describe '#to_sql' do
it "manufactures a simple select query" do
- @relation.to_sql.should be_like("""
+ @relation.to_sql.should be_like("
SELECT `users`.`id`, `users`.`name`
FROM `users`
- """)
+ ")
end
end
describe '#column_for' do
it "" do
- pending
+ @relation[:id].column.should == @relation.columns.detect { |c| c.name == 'id' }
end
end
@@ -72,5 +72,13 @@ module ActiveRelation
@relation.qualify.should == Rename.new(@relation, @relation[:name] => 'users.name', @relation[:id] => 'users.id')
end
end
+
+ describe 'hashing' do
+ it "implements hash equality" do
+ hash = {}
+ hash[Table.new(:users)] = 1
+ hash[Table.new(:users)].should == 1
+ end
+ end
end
end \ No newline at end of file