提交 56ce36fb 编写于 作者: I Ivan Ukhov 提交者: Aaron Patterson

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

上级 9ef7afda
......@@ -4,4 +4,5 @@ spec/support/fixtures/*database*
*.DS_Store
debug.log
pkg
.bundle
\ No newline at end of file
.bundle
*.swp
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册