Commit c26131ae authored by Tugce Nur Tas's avatar Tugce Nur Tas Committed by Tuğçe Nur Taş
Browse files

add model test record still exists after deletion

parent bd7ce2ed
......@@ -62,4 +62,18 @@ class UserTest < ActiveSupport::TestCase
context 'associations' do
should have_many(:clients)
end
test 'record still exists after deletion' do
User.last.destroy
assert_equal 7, User.count
assert_equal 8, User.with_deleted.count
assert_equal 1, User.only_deleted.count
assert_equal 8, User.unscoped.count
User.destroy_all
assert_equal 0, User.count
assert_equal 8, User.with_deleted.count
assert_equal 8, User.only_deleted.count
assert_equal 8, User.unscoped.count
end
end
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment