diff options
author | Victor Costan <costan@gmail.com> | 2015-06-04 12:27:45 -0400 |
---|---|---|
committer | Victor Costan <costan@gmail.com> | 2015-06-04 12:38:00 -0400 |
commit | 2b2f41fd972133b8bfbbc94ebe3bec6b27a0689a (patch) | |
tree | 7c8b25bb4451139b0d43c587082ef56d59d964ee /activerecord/test/cases | |
parent | 7220ffcffd0085b3caee872102b3b28f3ca35c83 (diff) | |
download | rails-2b2f41fd972133b8bfbbc94ebe3bec6b27a0689a.tar.gz rails-2b2f41fd972133b8bfbbc94ebe3bec6b27a0689a.tar.bz2 rails-2b2f41fd972133b8bfbbc94ebe3bec6b27a0689a.zip |
Fix crash when loading fixture with belongs_to association defined in abstract base class.
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/fixtures_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/test/cases/fixtures_test.rb b/activerecord/test/cases/fixtures_test.rb index 47532c84e8..03a187ae92 100644 --- a/activerecord/test/cases/fixtures_test.rb +++ b/activerecord/test/cases/fixtures_test.rb @@ -16,6 +16,7 @@ require 'models/joke' require 'models/matey' require 'models/parrot' require 'models/pirate' +require 'models/doubloon' require 'models/post' require 'models/randomly_named_c1' require 'models/reply' @@ -903,3 +904,12 @@ class FixturesWithDefaultScopeTest < ActiveRecord::TestCase assert_equal "special", bulbs(:special).name end end + +class FixturesWithAbstractBelongsTo < ActiveRecord::TestCase + fixtures :pirates, :doubloons + + test "creates fixtures with belongs_to associations defined in abstract base classes" do + assert_not_nil doubloons(:blackbeards_doubloon) + assert_equal pirates(:blackbeard), doubloons(:blackbeards_doubloon).pirate + end +end |