Method: Shoulda::Macros#should_destroy
- Defined in:
- lib/shoulda/macros.rb
#should_destroy(class_name) ⇒ Object
Deprecated.
Macro that creates a test asserting that a record of the given class was destroyed.
Example:
context "destroying a post" do
setup { Post.first.destroy }
should_destroy :post
end
138 139 140 141 |
# File 'lib/shoulda/macros.rb', line 138 def should_destroy(class_name) ::ActiveSupport::Deprecation.warn should_change_record_count_of(class_name, -1, 'destroy') end |