mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add test to avoid regression of 58e48d5292
This commit is contained in:
parent
9abec81622
commit
6876f4a787
1 changed files with 11 additions and 0 deletions
|
@ -185,6 +185,17 @@ class TestNestedAttributesInGeneral < ActiveRecord::TestCase
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue