debian-mirror-gitlab/spec/models/concerns/delete_with_limit_spec.rb
2020-08-09 17:41:57 +05:30

15 lines
327 B
Ruby

# frozen_string_literal: true
require 'spec_helper'
RSpec.describe DeleteWithLimit do
describe '.delete_with_limit' do
it 'deletes a limited amount of rows' do
create_list(:web_hook_log, 4)
expect do
WebHookLog.delete_with_limit(2)
end.to change { WebHookLog.count }.by(-2)
end
end
end