mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 14:44:47 +02:00
Improve domain discard
- Extract rake task domain:discard - Remove background job when keeping a domain #790
This commit is contained in:
parent
00a30fc019
commit
e776d09f9d
10 changed files with 104 additions and 46 deletions
|
@ -871,22 +871,6 @@ RSpec.describe Domain do
|
|||
end
|
||||
end
|
||||
|
||||
describe '::delete_candidates', db: true do
|
||||
before :example do
|
||||
travel_to Time.zone.parse('05.07.2010 00:00')
|
||||
|
||||
create(:zone, origin: 'ee')
|
||||
|
||||
create(:domain, id: 1, delete_at: Time.zone.parse('04.07.2010 23:59'))
|
||||
create(:domain, id: 2, delete_at: Time.zone.parse('05.07.2010 00:00'))
|
||||
create(:domain, id: 3, delete_at: Time.zone.parse('05.07.2010 00:01'))
|
||||
end
|
||||
|
||||
it 'returns domains with delete time in the past' do
|
||||
expect(described_class.delete_candidates.ids).to eq([1])
|
||||
end
|
||||
end
|
||||
|
||||
describe '::uses_zone?', db: true do
|
||||
let!(:zone) { create(:zone, origin: 'domain.tld') }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue