Add sidekiq as a job backend

This commit is contained in:
Alex Sherman 2021-03-03 16:37:33 +05:00
parent 313731232e
commit 929ada8fd0
22 changed files with 109 additions and 154 deletions

View file

@ -1,4 +1,7 @@
require 'application_system_test_case'
require 'sidekiq/testing'
Sidekiq::Testing.fake!
class AdminDomainsTestTest < ApplicationSystemTestCase
setup do

View file

@ -1,42 +0,0 @@
require 'application_system_test_case'
class DomainDeleteConfirmsTest < ApplicationSystemTestCase
include ActionMailer::TestHelper
setup do
@user = users(:registrant)
sign_in @user
@domain = domains(:shop)
@domain.registrant_verification_asked!('<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<epp></epp>', @user.id)
@domain.pending_delete!
end
def test_enqueues_approve_job_after_verification
visit registrant_domain_delete_confirm_url(@domain.id, token: @domain.registrant_verification_token)
click_on 'Confirm domain delete'
assert_text 'Domain registrant change has successfully received.'
assert_enqueued_jobs 1, only: DomainDeleteConfirmJob
end
def test_enqueues_reject_job_after_verification
visit registrant_domain_delete_confirm_url(@domain.id, token: @domain.registrant_verification_token)
click_on 'Reject domain delete'
assert_text 'Domain registrant change has been rejected successfully.'
assert_enqueued_jobs 1, only: DomainDeleteConfirmJob
end
def test_saves_whodunnit_info_after_verifivation
visit registrant_domain_delete_confirm_url(@domain.id, token: @domain.registrant_verification_token)
token = @domain.registrant_verification_token
click_on 'Confirm domain delete'
assert_text 'Domain registrant change has successfully received.'
refute RegistrantVerification.find_by(verification_token:token).updator_str.empty?
end
end