mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 19:48:28 +02:00
Merge branch 'master' into registry-623
# Conflicts: # test/integration/admin/registrars/show_registrar_test.rb
This commit is contained in:
commit
7ffc62e370
34 changed files with 72 additions and 44 deletions
|
@ -37,7 +37,7 @@
|
||||||
= f.email_field :bcc, class: 'form-control'
|
= f.email_field :bcc, class: 'form-control'
|
||||||
.form-group
|
.form-group
|
||||||
.col-md-12
|
.col-md-12
|
||||||
= f.label :body, t(:html_body)
|
= f.label :body, t('admin.mail_templates.html_body')
|
||||||
= liquid_help
|
= liquid_help
|
||||||
.col-md-12
|
.col-md-12
|
||||||
= f.text_area(:body, class: 'form-control', size: '15x15')
|
= f.text_area(:body, class: 'form-control', size: '15x15')
|
||||||
|
@ -48,7 +48,7 @@
|
||||||
.col-md-12
|
.col-md-12
|
||||||
= f.text_area(:text_body, class: 'form-control', size: '15x15')
|
= f.text_area(:text_body, class: 'form-control', size: '15x15')
|
||||||
|
|
||||||
%hr
|
%hr
|
||||||
.row
|
.row
|
||||||
.col-md-12.text-right
|
.col-md-12.text-right
|
||||||
= button_tag(t(:save), class: 'btn btn-primary')
|
= button_tag(t(:save), class: 'btn btn-primary')
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
= render 'shared/title', name: t(:new_mail_template)
|
= render 'shared/title', name: t('admin.mail_templates.new_mail_template')
|
||||||
|
|
||||||
= render 'form', mail_template: @mail_template
|
= render 'form', mail_template: @mail_template
|
||||||
|
|
|
@ -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
|
||||||
|
|
5
config/locales/admin/mail_templates.en.yml
Normal file
5
config/locales/admin/mail_templates.en.yml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
en:
|
||||||
|
admin:
|
||||||
|
mail_templates:
|
||||||
|
html_body: HTML body
|
||||||
|
new_mail_template: New mail template
|
|
@ -729,7 +729,6 @@ en:
|
||||||
is_registrant: 'Is registrant'
|
is_registrant: 'Is registrant'
|
||||||
force_delete_set_on_domain: 'Force delete set on domain %{domain_name}'
|
force_delete_set_on_domain: 'Force delete set on domain %{domain_name}'
|
||||||
mail_templates: Mail Templates
|
mail_templates: Mail Templates
|
||||||
new_mail_template: New mail template
|
|
||||||
failure: "It was not saved"
|
failure: "It was not saved"
|
||||||
contact_is_not_valid: 'Contact %{value} is not valid, please fix the invalid contact'
|
contact_is_not_valid: 'Contact %{value} is not valid, please fix the invalid contact'
|
||||||
welcome_to_eis_registrar_portal: 'Welcome to EIS Registrar portal'
|
welcome_to_eis_registrar_portal: 'Welcome to EIS Registrar portal'
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
14
test/integration/admin/mail_templates/new_test.rb
Normal file
14
test/integration/admin/mail_templates/new_test.rb
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class AdminAreaNewMailTemplateTest < ActionDispatch::IntegrationTest
|
||||||
|
def setup
|
||||||
|
login_as users(:admin)
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_new_mail_template_does_not_throw_template_error
|
||||||
|
visit admin_mail_templates_url
|
||||||
|
click_link_or_button 'New'
|
||||||
|
assert_text "HTML body"
|
||||||
|
assert_text "New mail template"
|
||||||
|
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
|
||||||
|
|
||||||
|
|
|
@ -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,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
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,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
|
||||||
|
@ -29,8 +33,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