aboutsummaryrefslogtreecommitdiffstats
path: root/spec/active_relation/unit/relations/table_spec.rb
diff options
context:
space:
mode:
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