mirror of
https://github.com/internetee/registry.git
synced 2025-06-07 21:25:39 +02:00
Use setup/teardown blocks instead of methods
This commit is contained in:
parent
b1e0371188
commit
f8eda810f9
29 changed files with 29 additions and 29 deletions
|
@ -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 RegistrarDomainTransfersTest < ActionDispatch::IntegrationTest
|
class RegistrarDomainTransfersTest < ActionDispatch::IntegrationTest
|
||||||
def setup
|
setup do
|
||||||
WebMock.reset!
|
WebMock.reset!
|
||||||
login_as users(:api_goodnames)
|
login_as users(:api_goodnames)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class RegistrarNameserverReplacementTest < ActionDispatch::IntegrationTest
|
class RegistrarNameserverReplacementTest < ActionDispatch::IntegrationTest
|
||||||
def setup
|
setup do
|
||||||
WebMock.reset!
|
WebMock.reset!
|
||||||
login_as users(:api_goodnames)
|
login_as users(:api_goodnames)
|
||||||
end
|
end
|
||||||
|
|
|
@ -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,7 +12,7 @@ class ContactIdenticalTest < ActiveSupport::TestCase
|
||||||
org_name
|
org_name
|
||||||
]
|
]
|
||||||
|
|
||||||
def setup
|
setup do
|
||||||
@contact = contacts(:william)
|
@contact = contacts(:william)
|
||||||
@identical = contacts(:identical_to_william)
|
@identical = contacts(:identical_to_william)
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require 'test_helper'
|
require 'test_helper'
|
||||||
|
|
||||||
class ContactPostalAddressTest < ActiveSupport::TestCase
|
class ContactPostalAddressTest < ActiveSupport::TestCase
|
||||||
def setup
|
setup do
|
||||||
@contact = contacts(:john)
|
@contact = contacts(:john)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ 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!
|
||||||
Capybara.reset_sessions!
|
Capybara.reset_sessions!
|
||||||
Capybara.use_default_driver
|
Capybara.use_default_driver
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue