mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 18:56:05 +02:00
Add interactor tests
This commit is contained in:
parent
d406334926
commit
4c7f9f2026
4 changed files with 28 additions and 13 deletions
|
@ -0,0 +1,25 @@
|
|||
require 'test_helper'
|
||||
|
||||
class DomainDeleteInteractionDeleteTest < ActiveSupport::TestCase
|
||||
setup do
|
||||
@domain = domains(:shop)
|
||||
end
|
||||
|
||||
def test_discards_domains_with_past_delete_date
|
||||
@domain.update!(delete_date: '2010-07-04')
|
||||
travel_to Time.zone.parse('2010-07-05')
|
||||
|
||||
DomainDeleteInteraction::Delete.run(domain: @domain)
|
||||
|
||||
assert @domain.destroyed?
|
||||
end
|
||||
|
||||
def test_sends_notification
|
||||
@domain.update!(delete_date: '2010-07-04')
|
||||
travel_to Time.zone.parse('2010-07-05')
|
||||
|
||||
assert_difference '@domain.registrar.notifications.count', 1 do
|
||||
DomainDeleteInteraction::Delete.run(domain: @domain)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue