mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
parent
10fca3e816
commit
7e51522585
3 changed files with 18 additions and 2 deletions
|
@ -157,8 +157,10 @@ class Epp::DomainsController < EppController
|
||||||
end
|
end
|
||||||
|
|
||||||
def validate_create
|
def validate_create
|
||||||
|
if Domain.nameserver_required?
|
||||||
@prefix = 'create > create >'
|
@prefix = 'create > create >'
|
||||||
requires 'name', 'ns', 'registrant', 'ns > hostAttr'
|
requires 'name', 'ns', 'registrant', 'ns > hostAttr'
|
||||||
|
end
|
||||||
|
|
||||||
@prefix = 'extension > create >'
|
@prefix = 'extension > create >'
|
||||||
mutually_exclusive 'keyData', 'dsData'
|
mutually_exclusive 'keyData', 'dsData'
|
||||||
|
|
|
@ -245,6 +245,10 @@ class Domain < ActiveRecord::Base
|
||||||
{ admin_contacts: :registrar }
|
{ admin_contacts: :registrar }
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def nameserver_required?
|
||||||
|
Setting.nameserver_required
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def name=(value)
|
def name=(value)
|
||||||
|
|
|
@ -704,6 +704,16 @@ RSpec.describe Domain, db: false do
|
||||||
it { is_expected.to alias_attribute(:force_delete_time, :force_delete_at) }
|
it { is_expected.to alias_attribute(:force_delete_time, :force_delete_at) }
|
||||||
it { is_expected.to alias_attribute(:outzone_time, :outzone_at) }
|
it { is_expected.to alias_attribute(:outzone_time, :outzone_at) }
|
||||||
|
|
||||||
|
describe '::nameserver_required?' do
|
||||||
|
before do
|
||||||
|
Setting.nameserver_required = 'test'
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'returns setting value' do
|
||||||
|
expect(described_class.nameserver_required?).to eq('test')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe '::expire_warning_period', db: true do
|
describe '::expire_warning_period', db: true do
|
||||||
before :example do
|
before :example do
|
||||||
Setting.expire_warning_period = 1
|
Setting.expire_warning_period = 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue