mirror of
https://github.com/internetee/registry.git
synced 2025-06-11 07:04:47 +02:00
Merge branch 'tune-test-env' into registry-662
# Conflicts: # test/integration/registrar/bulk_change/nameserver_test.rb # test/integration/registrar/domain_transfers_test.rb
This commit is contained in:
commit
77135b34ba
28 changed files with 49 additions and 39 deletions
|
@ -43,6 +43,7 @@ Rails.application.configure do
|
||||||
config.log_level = :debug
|
config.log_level = :debug
|
||||||
config.active_job.queue_adapter = :test
|
config.active_job.queue_adapter = :test
|
||||||
config.logger = ActiveSupport::Logger.new(nil)
|
config.logger = ActiveSupport::Logger.new(nil)
|
||||||
|
config.active_support.test_order = :random # :random is the default in Rails 5
|
||||||
end
|
end
|
||||||
|
|
||||||
# In this mode, any jobs you queue will be run in the same thread, synchronously
|
# In this mode, any jobs you queue will be run in the same thread, synchronously
|
||||||
|
|
|
@ -3,7 +3,7 @@ require 'test_helper'
|
||||||
class AdminAreaDomainForceDeleteTest < ActionDispatch::IntegrationTest
|
class AdminAreaDomainForceDeleteTest < ActionDispatch::IntegrationTest
|
||||||
include ActionMailer::TestHelper
|
include ActionMailer::TestHelper
|
||||||
|
|
||||||
def setup
|
setup do
|
||||||
login_as users(:admin)
|
login_as users(:admin)
|
||||||
@domain = domains(:shop)
|
@domain = domains(:shop)
|
||||||
ActionMailer::Base.deliveries.clear
|
ActionMailer::Base.deliveries.clear
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class AdminDomainsTestTest < ActionDispatch::IntegrationTest
|
class AdminDomainsTestTest < ActionDispatch::IntegrationTest
|
||||||
def setup
|
setup do
|
||||||
login_as users(:admin)
|
login_as users(:admin)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class AdminAreaDeleteRegistrarTest < ActionDispatch::IntegrationTest
|
class AdminAreaDeleteRegistrarTest < ActionDispatch::IntegrationTest
|
||||||
def setup
|
setup do
|
||||||
login_as users(:admin)
|
login_as users(:admin)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class AdminAreaEditRegistrarTest < ActionDispatch::IntegrationTest
|
class AdminAreaEditRegistrarTest < ActionDispatch::IntegrationTest
|
||||||
def setup
|
setup do
|
||||||
login_as users(:admin)
|
login_as users(:admin)
|
||||||
@registrar = registrars(:bestnames)
|
@registrar = registrars(:bestnames)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class AdminAreaNewRegistrarTest < ActionDispatch::IntegrationTest
|
class AdminAreaNewRegistrarTest < ActionDispatch::IntegrationTest
|
||||||
def setup
|
setup do
|
||||||
login_as users(:admin)
|
login_as users(:admin)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ require 'test_helper'
|
||||||
class ShowRegistrarTest < ActionDispatch::IntegrationTest
|
class ShowRegistrarTest < ActionDispatch::IntegrationTest
|
||||||
include ActionView::Helpers::NumberHelper
|
include ActionView::Helpers::NumberHelper
|
||||||
|
|
||||||
def setup
|
setup do
|
||||||
login_as users(:admin)
|
login_as users(:admin)
|
||||||
@registrar = registrars(:bestnames)
|
@registrar = registrars(:bestnames)
|
||||||
visit admin_registrar_path(@registrar)
|
visit admin_registrar_path(@registrar)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class APIDomainTransfersTest < ActionDispatch::IntegrationTest
|
class APIDomainTransfersTest < ActionDispatch::IntegrationTest
|
||||||
def setup
|
setup do
|
||||||
@domain = domains(:shop)
|
@domain = domains(:shop)
|
||||||
@new_registrar = registrars(:goodnames)
|
@new_registrar = registrars(:goodnames)
|
||||||
Setting.transfer_wait_time = 0 # Auto-approval
|
Setting.transfer_wait_time = 0 # Auto-approval
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class EppDomainCreateTransferCodeTest < ActionDispatch::IntegrationTest
|
class EppDomainCreateTransferCodeTest < ActionDispatch::IntegrationTest
|
||||||
def setup
|
setup do
|
||||||
travel_to Time.zone.parse('2010-07-05')
|
travel_to Time.zone.parse('2010-07-05')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ require 'test_helper'
|
||||||
class EppDomainRenewTest < ActionDispatch::IntegrationTest
|
class EppDomainRenewTest < ActionDispatch::IntegrationTest
|
||||||
self.use_transactional_fixtures = false
|
self.use_transactional_fixtures = false
|
||||||
|
|
||||||
def setup
|
setup do
|
||||||
travel_to Time.zone.parse('2010-07-05')
|
travel_to Time.zone.parse('2010-07-05')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class EppDomainTransferRequestTest < ActionDispatch::IntegrationTest
|
class EppDomainTransferRequestTest < ActionDispatch::IntegrationTest
|
||||||
def setup
|
setup do
|
||||||
@domain = domains(:shop)
|
@domain = domains(:shop)
|
||||||
@new_registrar = registrars(:goodnames)
|
@new_registrar = registrars(:goodnames)
|
||||||
Setting.transfer_wait_time = 0
|
Setting.transfer_wait_time = 0
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class EppLoginSessionLimitTest < ActionDispatch::IntegrationTest
|
class EppLoginSessionLimitTest < ActionDispatch::IntegrationTest
|
||||||
def setup
|
setup do
|
||||||
travel_to Time.zone.parse('2010-07-05')
|
travel_to Time.zone.parse('2010-07-05')
|
||||||
EppSession.delete_all
|
EppSession.delete_all
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class RegistrantDomainsTest < ActionDispatch::IntegrationTest
|
class RegistrantDomainsTest < ActionDispatch::IntegrationTest
|
||||||
def setup
|
setup do
|
||||||
login_as users(:registrant)
|
login_as users(:registrant)
|
||||||
|
|
||||||
Setting.days_to_keep_business_registry_cache = 1
|
Setting.days_to_keep_business_registry_cache = 1
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class ContactTest < ActiveSupport::TestCase
|
class ContactTest < ActiveSupport::TestCase
|
||||||
def setup
|
setup do
|
||||||
@contact = contacts(:john)
|
@contact = contacts(:john)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -12,11 +12,16 @@ class ContactIdenticalTest < ActiveSupport::TestCase
|
||||||
org_name
|
org_name
|
||||||
]
|
]
|
||||||
|
|
||||||
def setup
|
setup do
|
||||||
|
@original_address_processing = Setting.address_processing
|
||||||
@contact = contacts(:william)
|
@contact = contacts(:william)
|
||||||
@identical = contacts(:identical_to_william)
|
@identical = contacts(:identical_to_william)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
teardown do
|
||||||
|
Setting.address_processing = @original_address_processing
|
||||||
|
end
|
||||||
|
|
||||||
def test_returns_identical
|
def test_returns_identical
|
||||||
assert_equal @identical, @contact.identical(@identical.registrar)
|
assert_equal @identical, @contact.identical(@identical.registrar)
|
||||||
end
|
end
|
||||||
|
@ -33,30 +38,24 @@ class ContactIdenticalTest < ActiveSupport::TestCase
|
||||||
assert_nil @contact.identical(@identical.registrar)
|
assert_nil @contact.identical(@identical.registrar)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_takes_address_into_account_when_processing_enabled
|
def test_takes_address_into_account_when_address_processing_is_on
|
||||||
|
Setting.address_processing = true
|
||||||
|
|
||||||
Contact.address_attribute_names.each do |attribute|
|
Contact.address_attribute_names.each do |attribute|
|
||||||
previous_value = @identical.public_send(attribute)
|
previous_value = @identical.public_send(attribute)
|
||||||
@identical.update_attribute(attribute, 'other')
|
@identical.update_attribute(attribute, 'other')
|
||||||
|
assert_nil @contact.identical(@identical.registrar)
|
||||||
Contact.stub :address_processing?, true do
|
|
||||||
assert_nil @contact.identical(@identical.registrar)
|
|
||||||
end
|
|
||||||
|
|
||||||
@identical.update_attribute(attribute, previous_value)
|
@identical.update_attribute(attribute, previous_value)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_ignores_address_when_processing_disabled
|
def test_ignores_address_when_address_processing_is_off
|
||||||
Setting.address_processing = false
|
Setting.address_processing = false
|
||||||
|
|
||||||
Contact.address_attribute_names.each do |attribute|
|
Contact.address_attribute_names.each do |attribute|
|
||||||
previous_value = @identical.public_send(attribute)
|
previous_value = @identical.public_send(attribute)
|
||||||
@identical.update_attribute(attribute, 'other')
|
@identical.update_attribute(attribute, 'other')
|
||||||
|
assert_equal @identical, @contact.identical(@identical.registrar)
|
||||||
Contact.stub :address_processing?, false do
|
|
||||||
assert_equal @identical, @contact.identical(@identical.registrar)
|
|
||||||
end
|
|
||||||
|
|
||||||
@identical.update_attribute(attribute, previous_value)
|
@identical.update_attribute(attribute, previous_value)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,10 +1,15 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class ContactPostalAddressTest < ActiveSupport::TestCase
|
class ContactPostalAddressTest < ActiveSupport::TestCase
|
||||||
def setup
|
setup do
|
||||||
|
@original_address_processing = Setting.address_processing
|
||||||
@contact = contacts(:john)
|
@contact = contacts(:john)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
teardown do
|
||||||
|
Setting.address_processing = @original_address_processing
|
||||||
|
end
|
||||||
|
|
||||||
def test_invalid_if_country_code_is_invalid_and_address_processing_is_on
|
def test_invalid_if_country_code_is_invalid_and_address_processing_is_on
|
||||||
Setting.address_processing = true
|
Setting.address_processing = true
|
||||||
@contact.country_code = 'invalid'
|
@contact.country_code = 'invalid'
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class ContactTransferTest < ActiveSupport::TestCase
|
class ContactTransferTest < ActiveSupport::TestCase
|
||||||
def setup
|
setup do
|
||||||
@contact = contacts(:john)
|
@contact = contacts(:john)
|
||||||
@new_registrar = registrars(:goodnames)
|
@new_registrar = registrars(:goodnames)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class DomainTest < ActiveSupport::TestCase
|
class DomainTest < ActiveSupport::TestCase
|
||||||
def setup
|
setup do
|
||||||
@domain = domains(:shop)
|
@domain = domains(:shop)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class DomainTransferableTest < ActiveSupport::TestCase
|
class DomainTransferableTest < ActiveSupport::TestCase
|
||||||
def setup
|
setup do
|
||||||
@domain = domains(:shop)
|
@domain = domains(:shop)
|
||||||
@new_registrar = registrars(:goodnames)
|
@new_registrar = registrars(:goodnames)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class DomainTransferTest < ActiveSupport::TestCase
|
class DomainTransferTest < ActiveSupport::TestCase
|
||||||
def setup
|
setup do
|
||||||
@domain_transfer = domain_transfers(:shop)
|
@domain_transfer = domain_transfers(:shop)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class EppSessionTest < ActiveSupport::TestCase
|
class EppSessionTest < ActiveSupport::TestCase
|
||||||
def setup
|
setup do
|
||||||
@epp_session = epp_sessions(:api_bestnames)
|
@epp_session = epp_sessions(:api_bestnames)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class MessageTest < ActiveSupport::TestCase
|
class MessageTest < ActiveSupport::TestCase
|
||||||
def setup
|
setup do
|
||||||
@message = messages(:greeting)
|
@message = messages(:greeting)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class NameserverGlueRecordTest < ActiveSupport::TestCase
|
class NameserverGlueRecordTest < ActiveSupport::TestCase
|
||||||
def setup
|
setup do
|
||||||
@nameserver = nameservers(:shop_ns1)
|
@nameserver = nameservers(:shop_ns1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class NameserverTest < ActiveSupport::TestCase
|
class NameserverTest < ActiveSupport::TestCase
|
||||||
def setup
|
setup do
|
||||||
@nameserver = nameservers(:shop_ns1)
|
@nameserver = nameservers(:shop_ns1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class RegistrarCodeTest < ActiveSupport::TestCase
|
class RegistrarCodeTest < ActiveSupport::TestCase
|
||||||
def setup
|
setup do
|
||||||
@registrar = registrars(:bestnames).dup
|
@registrar = registrars(:bestnames).dup
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class DeleteRegistrarTest < ActiveSupport::TestCase
|
class DeleteRegistrarTest < ActiveSupport::TestCase
|
||||||
def setup
|
setup do
|
||||||
@registrar = registrars(:not_in_use)
|
@registrar = registrars(:not_in_use)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class RegistrarTest < ActiveSupport::TestCase
|
class RegistrarTest < ActiveSupport::TestCase
|
||||||
def setup
|
setup do
|
||||||
@registrar = registrars(:bestnames)
|
@registrar = registrars(:bestnames)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,10 @@ class ActiveSupport::TestCase
|
||||||
|
|
||||||
ActiveRecord::Migration.check_pending!
|
ActiveRecord::Migration.check_pending!
|
||||||
fixtures :all
|
fixtures :all
|
||||||
|
|
||||||
|
teardown do
|
||||||
|
travel_back
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class ActionDispatch::IntegrationTest
|
class ActionDispatch::IntegrationTest
|
||||||
|
@ -28,8 +32,9 @@ class ActionDispatch::IntegrationTest
|
||||||
include Capybara::Minitest::Assertions
|
include Capybara::Minitest::Assertions
|
||||||
include AbstractController::Translation
|
include AbstractController::Translation
|
||||||
|
|
||||||
def teardown
|
teardown do
|
||||||
Warden.test_reset!
|
Warden.test_reset!
|
||||||
|
WebMock.reset!
|
||||||
Capybara.reset_sessions!
|
Capybara.reset_sessions!
|
||||||
Capybara.use_default_driver
|
Capybara.use_default_driver
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue