Skip to content

Commit

Permalink
Merge pull request #8145 from sobrinho/master
Browse files Browse the repository at this point in the history
Add test to avoid regression of 58e48d5
  • Loading branch information
rafaelfranca committed Nov 8, 2012
2 parents f8ca941 + 6876f4a commit 772883c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions activerecord/test/cases/nested_attributes_test.rb
Expand Up @@ -185,6 +185,17 @@ def parrot_attributes=(attrs)
assert_equal "James", mean_pirate.parrot.name
assert_equal "blue", mean_pirate.parrot.color
end

def test_accepts_nested_attributes_for_can_be_overridden_in_subclasses
Pirate.accepts_nested_attributes_for(:parrot)

mean_pirate_class = Class.new(Pirate) do
accepts_nested_attributes_for :parrot
end
mean_pirate = mean_pirate_class.new
mean_pirate.parrot_attributes = { :name => "James" }
assert_equal "James", mean_pirate.parrot.name
end
end

class TestNestedAttributesOnAHasOneAssociation < ActiveRecord::TestCase
Expand Down

0 comments on commit 772883c

Please sign in to comment.