diff options
author | Yves Senn <yves.senn@gmail.com> | 2015-01-06 13:31:34 +0100 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2015-01-06 13:31:50 +0100 |
commit | dd54b518cebf5b875fa5f75b124a44185b7684b1 (patch) | |
tree | 0af3f874cf937ae38a030ef6628e90dda3fcf689 /activerecord/test | |
parent | de4f40826e3b979735e4f3287725f1a7a3820818 (diff) | |
parent | 8da936a5d370aa2616ef532e1b65a32c514f518d (diff) | |
download | rails-dd54b518cebf5b875fa5f75b124a44185b7684b1.tar.gz rails-dd54b518cebf5b875fa5f75b124a44185b7684b1.tar.bz2 rails-dd54b518cebf5b875fa5f75b124a44185b7684b1.zip |
Merge pull request #18358 from prathamesh-sonpatki/add-test-for-non-string-labeled-fixtures
Fix lookup of fixtures with non-string(like Fixnum) label
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/fixtures_test.rb | 4 | ||||
-rw-r--r-- | activerecord/test/fixtures/pirates.yml | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/fixtures_test.rb b/activerecord/test/cases/fixtures_test.rb index 9edeb8b47f..07ec08ccf5 100644 --- a/activerecord/test/cases/fixtures_test.rb +++ b/activerecord/test/cases/fixtures_test.rb @@ -792,6 +792,10 @@ class FoxyFixturesTest < ActiveRecord::TestCase assert_equal("X marks the spot!", pirates(:mark).catchphrase) end + def test_supports_label_interpolation_for_fixnum_label + assert_equal("#1 pirate!", pirates(1).catchphrase) + end + def test_supports_polymorphic_belongs_to assert_equal(pirates(:redbeard), treasures(:sapphire).looter) assert_equal(parrots(:louis), treasures(:ruby).looter) diff --git a/activerecord/test/fixtures/pirates.yml b/activerecord/test/fixtures/pirates.yml index 1bb3bf0051..0b1a785853 100644 --- a/activerecord/test/fixtures/pirates.yml +++ b/activerecord/test/fixtures/pirates.yml @@ -10,3 +10,6 @@ redbeard: mark: catchphrase: "X $LABELs the spot!" + +1: + catchphrase: "#$LABEL pirate!" |