Skip to content

Commit

Permalink
Write a test for checking the presence of table names in the cache
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanUkhov authored and tenderlove committed Nov 17, 2010
1 parent 9ef7afd commit 56ce36f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -4,4 +4,5 @@ spec/support/fixtures/*database*
*.DS_Store
debug.log
pkg
.bundle
.bundle
*.swp
13 changes: 12 additions & 1 deletion test/test_table.rb
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 56ce36f

Please sign in to comment.