diff options
author | Yves Senn <yves.senn@gmail.com> | 2015-03-06 13:25:07 +0100 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2015-03-06 13:25:07 +0100 |
commit | deed34d8bd2712f680055f398d9f2d22bf710115 (patch) | |
tree | caeb49fe3979d31162f3b25eb9fba987c040a3a3 /activerecord/test/cases | |
parent | a068aa3e86215da4d50ac5a8862ce11ed33140ca (diff) | |
download | rails-deed34d8bd2712f680055f398d9f2d22bf710115.tar.gz rails-deed34d8bd2712f680055f398d9f2d22bf710115.tar.bz2 rails-deed34d8bd2712f680055f398d9f2d22bf710115.zip |
tests, sequences are derived from the base class.
Using a subclass to check the sequence name does not work in that case.
The sequence name will be calucalted based on the base class.
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/base_test.rb | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index 5016dcea43..4306738670 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -1021,17 +1021,20 @@ class BasicsTest < ActiveRecord::TestCase end def test_clear_cash_when_setting_table_name - k = Class.new(Joke) - k.table_name = "cold_jokes" - before_columns = k.columns - before_seq = k.sequence_name + original_table_name = Joke.table_name - k.table_name = "funny_jokes" - after_columns = k.columns - after_seq = k.sequence_name + Joke.table_name = "funny_jokes" + before_columns = Joke.columns + before_seq = Joke.sequence_name + + Joke.table_name = "cold_jokes" + after_columns = Joke.columns + after_seq = Joke.sequence_name assert_not_equal before_columns, after_columns assert_not_equal before_seq, after_seq unless before_seq.nil? && after_seq.nil? + ensure + Joke.table_name = original_table_name end def test_dont_clear_sequence_name_when_setting_explicitly |