Permalink
Browse files

adding spec to ensure that in the future is_paranoid does not acciden…

…tally infect all ActiveRecord models and only applies to those specified
  • Loading branch information...
1 parent 54ae1ac commit b9bec02d05f19c9e6fc46f5f015cd43216ca692b Jeffrey Chupp committed May 8, 2009
Showing with 12 additions and 1 deletion.
  1. +12 −1 spec/is_paranoid_spec.rb
View
@@ -13,6 +13,18 @@
@r2d2.components.create(:name => 'Rotors')
end
+ describe 'non-is_paranoid models' do
+ it "should destroy as normal" do
+ lambda{
+ @luke.destroy
+ }.should change(Person, :count).by(-1)
+
+ lambda{
+ Person.count_with_destroyed
+ }.should raise_error(NoMethodError)
+ end
+ end
+
describe 'destroying' do
it "should soft-delete a record" do
lambda{
@@ -51,7 +63,6 @@
}.should change(Android, :count).from(2).to(0)
Android.count_with_destroyed.should == 2
end
-
end
end

0 comments on commit b9bec02

Please sign in to comment.