1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Write a test for checking the presence of table names in the cache

This commit is contained in:
Ivan Ukhov 2010-11-17 10:10:07 +08:00 committed by Aaron Patterson
parent 9ef7afda3b
commit 56ce36fb77
2 changed files with 14 additions and 2 deletions

3
.gitignore vendored
View file

@ -4,4 +4,5 @@ spec/support/fixtures/*database*
*.DS_Store *.DS_Store
debug.log debug.log
pkg pkg
.bundle .bundle
*.swp

View file

@ -156,7 +156,7 @@ module Arel
end end
it "should have a name" do it "should have a name" do
@relation.name.must_equal :users @relation.name.must_equal 'users'
end end
it "should have an engine" do it "should have an engine" do
@ -179,4 +179,15 @@ module Arel
end end
end 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 end