aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorVictor Costan <costan@gmail.com>2015-06-04 12:27:45 -0400
committerVictor Costan <costan@gmail.com>2015-06-04 12:38:00 -0400
commit2b2f41fd972133b8bfbbc94ebe3bec6b27a0689a (patch)
tree7c8b25bb4451139b0d43c587082ef56d59d964ee /activerecord/test/cases
parent7220ffcffd0085b3caee872102b3b28f3ca35c83 (diff)
downloadrails-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.rb10
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