Browse files

failing test case for #7845

  • Loading branch information...
1 parent 3395633 commit 4d7870d61b369ba22076d967a6f022dc34a6ac72 @senny committed Oct 9, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 activerecord/test/cases/relations_test.rb
View
5 activerecord/test/cases/relations_test.rb
@@ -1014,6 +1014,11 @@ def test_first_or_create_with_invalid_array
assert_raises(ActiveRecord::RecordInvalid) { Bird.where(:color => 'green').first_or_create!([ {:name => 'parrot'}, {:pirate_id => 1} ]) }
end
+ def test_first_or_create_respects_inheritance_column
+ firm = Company.where(:type => 'Firm', :name => 'I do not exist').first_or_create
+ assert_kind_of Firm, firm
+ end
+
def test_first_or_initialize
parrot = Bird.where(:color => 'green').first_or_initialize(:name => 'parrot')
assert_kind_of Bird, parrot

0 comments on commit 4d7870d

Please sign in to comment.