mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 09:57:23 +02:00
parent
10fca3e816
commit
7e51522585
3 changed files with 18 additions and 2 deletions
|
@ -157,8 +157,10 @@ class Epp::DomainsController < EppController
|
|||
end
|
||||
|
||||
def validate_create
|
||||
@prefix = 'create > create >'
|
||||
requires 'name', 'ns', 'registrant', 'ns > hostAttr'
|
||||
if Domain.nameserver_required?
|
||||
@prefix = 'create > create >'
|
||||
requires 'name', 'ns', 'registrant', 'ns > hostAttr'
|
||||
end
|
||||
|
||||
@prefix = 'extension > create >'
|
||||
mutually_exclusive 'keyData', 'dsData'
|
||||
|
|
|
@ -245,6 +245,10 @@ class Domain < ActiveRecord::Base
|
|||
{ admin_contacts: :registrar }
|
||||
)
|
||||
end
|
||||
|
||||
def nameserver_required?
|
||||
Setting.nameserver_required
|
||||
end
|
||||
end
|
||||
|
||||
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(: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
|
||||
before :example do
|
||||
Setting.expire_warning_period = 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue