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

adapt model test for record still exists after deletion

parent 3013b74a
......@@ -64,16 +64,12 @@ class UserTest < ActiveSupport::TestCase
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
user = create :user, :with_profile, role: 'admin'
assert_difference 'User.count', -1 do
user.destroy
end
assert User.unscoped.find(user.id)
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