Skip to content

Commit

Permalink
Added tests around Klass.paranoid?
Browse files Browse the repository at this point in the history
  • Loading branch information
chuckg committed Feb 22, 2012
1 parent e116e5a commit 7dd2c62
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions test/rails3_acts_as_paranoid_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ def teardown
end

class ParanoidTest < ParanoidBaseTest
def test_paranoid?
assert !NotParanoid.paranoid?
assert_raise(NoMethodError) { NotParanoid.delete_all! }
assert_raise(NoMethodError) { NotParanoid.first.destroy! }
assert_raise(NoMethodError) { NotParanoid.with_deleted }
assert_raise(NoMethodError) { NotParanoid.only_deleted }

assert ParanoidTime.paranoid?
end

def test_fake_removal
assert_equal 3, ParanoidTime.count
assert_equal 3, ParanoidBoolean.count
Expand Down Expand Up @@ -68,13 +78,6 @@ def test_real_removal
assert_empty ParanoidTime.with_deleted.all
end

def test_paranoid_scope
assert_raise(NoMethodError) { NotParanoid.delete_all! }
assert_raise(NoMethodError) { NotParanoid.first.destroy! }
assert_raise(NoMethodError) { NotParanoid.with_deleted }
assert_raise(NoMethodError) { NotParanoid.only_deleted }
end

def test_recovery
assert_equal 3, ParanoidBoolean.count
ParanoidBoolean.first.destroy
Expand Down

0 comments on commit 7dd2c62

Please sign in to comment.