From 86550ef2bee377a5e4134dc63dedb138bb9ab7dc Mon Sep 17 00:00:00 2001 From: Nick Kallen Date: Sun, 2 Mar 2008 17:05:06 -0800 Subject: new concept of session boundaries --- spec/active_relation/unit/relations/table_spec.rb | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'spec/active_relation/unit/relations/table_spec.rb') 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 -- cgit v1.2.3