aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorIvan Ukhov <uvsoft@gmail.com>2010-11-17 10:10:07 +0800
committerAaron Patterson <aaron.patterson@gmail.com>2010-11-17 12:48:36 +0800
commit56ce36fb775173199da3eb142aa1f729aeed956f (patch)
tree1c1ba36251879adc7a34d0e05574cc2222024115 /test
parent9ef7afda3beaab7979490665fe2648639ab91e1c (diff)
downloadrails-56ce36fb775173199da3eb142aa1f729aeed956f.tar.gz
rails-56ce36fb775173199da3eb142aa1f729aeed956f.tar.bz2
rails-56ce36fb775173199da3eb142aa1f729aeed956f.zip
Write a test for checking the presence of table names in the cache
Diffstat (limited to 'test')
-rw-r--r--test/test_table.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/test_table.rb b/test/test_table.rb
index 0dbb3f8dd1..2802ef9144 100644
--- a/test/test_table.rb
+++ b/test/test_table.rb
@@ -156,7 +156,7 @@ module Arel
end
it "should have a name" do
- @relation.name.must_equal :users
+ @relation.name.must_equal 'users'
end
it "should have an engine" do
@@ -179,4 +179,15 @@ module Arel
end
end
end
+
+ describe Table do
+ describe 'when checking existence of a table' do
+ it 'should be precent in the table cache despite the class of its name' do
+ [ 'users', :users ].each do |name|
+ relation = Table.new name
+ relation.send(:tables).key?(relation.name).must_equal true
+ end
+ end
+ end
+ end
end