diff options
author | Josh Peek <josh@joshpeek.com> | 2008-04-07 19:44:37 +0000 |
---|---|---|
committer | Josh Peek <josh@joshpeek.com> | 2008-04-07 19:44:37 +0000 |
commit | 4b68982f649c5b230b3e99954a71404c7cec03c7 (patch) | |
tree | 8aa1a83114fbf31af2856ebce5d99daacac8e540 /activerecord/test/cases | |
parent | 2cdc613598ae0774767c60e3c562fb6ca35971e0 (diff) | |
download | rails-4b68982f649c5b230b3e99954a71404c7cec03c7.tar.gz rails-4b68982f649c5b230b3e99954a71404c7cec03c7.tar.bz2 rails-4b68982f649c5b230b3e99954a71404c7cec03c7.zip |
Improve ActiveRecord::Base#table_name unit tests for nested classes. Closes #10289. [scott_willson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9237 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/modules_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/modules_test.rb b/activerecord/test/cases/modules_test.rb index c433da71f2..283333fc04 100644 --- a/activerecord/test/cases/modules_test.rb +++ b/activerecord/test/cases/modules_test.rb @@ -31,4 +31,9 @@ class ModulesTest < ActiveRecord::TestCase assert_kind_of MyApplication::Business::Firm, account.firm end + def test_table_name + assert_equal 'accounts', MyApplication::Billing::Account.table_name, 'table_name for ActiveRecord model in module' + assert_equal 'companies', MyApplication::Business::Client.table_name, 'table_name for ActiveRecord model subclass' + assert_equal 'company_contacts', MyApplication::Business::Client::Contact.table_name, 'table_name for ActiveRecord model enclosed by another ActiveRecord model' + end end |