mirror of
https://github.com/internetee/registry.git
synced 2025-06-08 13:44:47 +02:00
Change test structure to follow closer newer Rails 5 rules
* Create new class called ApplicationIntegrationTest, so we don't have to override ActionDispatch::IntegrationTest * Move UI tests to inherit from ApplicationSystemTestCase * Existing REST API or EPP tests inherit from ApplicationIntegrationTest. * Move `require 'application_system_test_case'` at the end of `test_helper` I don't particularly agree with the Rails' convention of treating UI tests as system tests and API tests as integration tests, but I see no benefit in actively fighting against it.
This commit is contained in:
parent
311aa503b3
commit
526a9ccd58
41 changed files with 42 additions and 42 deletions
|
@ -1,6 +1,6 @@
|
|||
require 'test_helper'
|
||||
|
||||
class EppDomainCreateNameserversTest < ActionDispatch::IntegrationTest
|
||||
class EppDomainCreateNameserversTest < ApplicationIntegrationTest
|
||||
# Glue record requirement
|
||||
def test_nameserver_ip_address_is_required_if_hostname_is_under_the_same_domain
|
||||
request_xml = <<-XML
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'test_helper'
|
||||
|
||||
class EppDomainCreateTransferCodeTest < ActionDispatch::IntegrationTest
|
||||
class EppDomainCreateTransferCodeTest < ApplicationIntegrationTest
|
||||
setup do
|
||||
travel_to Time.zone.parse('2010-07-05')
|
||||
end
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'test_helper'
|
||||
|
||||
class EppDomainDeleteTest < ActionDispatch::IntegrationTest
|
||||
class EppDomainDeleteTest < ApplicationIntegrationTest
|
||||
def test_bypasses_domain_and_registrant_and_contacts_validation
|
||||
request_xml = <<-XML
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'test_helper'
|
||||
|
||||
class EppDomainRenewTest < ActionDispatch::IntegrationTest
|
||||
class EppDomainRenewTest < ApplicationIntegrationTest
|
||||
self.use_transactional_fixtures = false
|
||||
|
||||
setup do
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'test_helper'
|
||||
|
||||
class EppDomainUpdateTest < ActionDispatch::IntegrationTest
|
||||
class EppDomainUpdateTest < ApplicationIntegrationTest
|
||||
def test_update_domain
|
||||
request_xml = <<-XML
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'test_helper'
|
||||
|
||||
class EppDomainTransferBaseTest < ActionDispatch::IntegrationTest
|
||||
class EppDomainTransferBaseTest < ApplicationIntegrationTest
|
||||
def test_non_existent_domain
|
||||
request_xml = <<-XML
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'test_helper'
|
||||
|
||||
class EppDomainTransferQueryTest < ActionDispatch::IntegrationTest
|
||||
class EppDomainTransferQueryTest < ApplicationIntegrationTest
|
||||
def test_returns_domain_transfer_details
|
||||
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
xml_doc = Nokogiri::XML(response.body)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'test_helper'
|
||||
|
||||
class EppDomainTransferRequestTest < ActionDispatch::IntegrationTest
|
||||
class EppDomainTransferRequestTest < ApplicationIntegrationTest
|
||||
setup do
|
||||
@domain = domains(:shop)
|
||||
@new_registrar = registrars(:goodnames)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'test_helper'
|
||||
|
||||
class EppLoginCredentialsTest < ActionDispatch::IntegrationTest
|
||||
class EppLoginCredentialsTest < ApplicationIntegrationTest
|
||||
def test_correct_credentials
|
||||
request_xml = <<-XML
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'test_helper'
|
||||
|
||||
class EppLoginSessionLimitTest < ActionDispatch::IntegrationTest
|
||||
class EppLoginSessionLimitTest < ApplicationIntegrationTest
|
||||
setup do
|
||||
travel_to Time.zone.parse('2010-07-05')
|
||||
EppSession.delete_all
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'test_helper'
|
||||
|
||||
class EppLogoutTest < ActionDispatch::IntegrationTest
|
||||
class EppLogoutTest < ApplicationIntegrationTest
|
||||
def test_success_response
|
||||
post '/epp/session/logout', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
assert Nokogiri::XML(response.body).at_css('result[code="1500"]')
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
require 'test_helper'
|
||||
|
||||
class EppPollTest < ActionDispatch::IntegrationTest
|
||||
class EppPollTest < ApplicationIntegrationTest
|
||||
def test_messages
|
||||
post '/epp/command/poll', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
assert_equal '1301', Nokogiri::XML(response.body).at_css('result')[:code]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue