Skip to content

Instantly share code, notes, and snippets.

@AquaGeek
Created May 14, 2011 02:36
Show Gist options
  • Select an option

  • Save AquaGeek/971858 to your computer and use it in GitHub Desktop.

Select an option

Save AquaGeek/971858 to your computer and use it in GitHub Desktop.
Rails Lighthouse ticket #6769
41c41
<
---
>
655,668d654
< def test_should_set_an_error_into_the_parent_on_before_destroy
< @child_1.class.before_destroy do |object|
< object.errors.add(:name, :undeletable)
< false
< end
<
< assert_no_difference('@pirate.send(@association_name).count') do
< @pirate.send(association_setter, @alternate_params[association_getter].merge('foo' => { :id => @child_1.id, '_destroy' => true }))
< @pirate.save
< end
<
< assert @pirate.errors[:"#{@association_name}.name"]
< end
<
786c772
<
---
>
792c778
<
---
>
798c784
<
---
>
803c789
<
---
>
808c794
<
---
>
825c811
<
---
>
831c817
<
---
>
837c823
<
---
>
842c828
<
---
>
847c833
<
---
>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment