diff --git a/app/models/domain.rb b/app/models/domain.rb index 1d1c3ccac..06dc0504d 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -48,7 +48,7 @@ class Domain < ActiveRecord::Base validate :validate_nameservers_uniqueness, if: :new_record? validate :validate_tech_contacts_uniqueness, if: :new_record? validate :validate_admin_contacts_uniqueness, if: :new_record? - validate :validate_domain_statuses_uniqueness, if: :new_record? + validate :validate_domain_statuses_uniqueness attr_accessor :owner_contact_typeahead diff --git a/app/models/domain_status.rb b/app/models/domain_status.rb index 49074da7f..96b34e75a 100644 --- a/app/models/domain_status.rb +++ b/app/models/domain_status.rb @@ -33,8 +33,6 @@ class DomainStatus < ActiveRecord::Base CLIENT_STATUSES = [CLIENT_DELETE_PROHIBITED, CLIENT_HOLD, CLIENT_RENEW_PROHIBITED, CLIENT_TRANSFER_PROHIBITED, CLIENT_UPDATE_PROHIBITED] SERVER_STATUSES = [SERVER_DELETE_PROHIBITED, SERVER_HOLD, SERVER_RENEW_PROHIBITED, SERVER_TRANSFER_PROHIBITED, SERVER_UPDATE_PROHIBITED, SERVER_MANUAL_INZONE, SERVER_REGISTRANT_CHANGE_PROHIBITED, SERVER_ADMIN_CHANGE_PROHIBITED, SERVER_TECH_CHANGE_PROHIBITED] - validates :value, uniqueness: { scope: :domain_id } - def epp_code_map { '2302' => [ # Object exists diff --git a/spec/epp/contact_spec.rb b/spec/epp/contact_spec.rb index 367d4d550..65b6e14c7 100644 --- a/spec/epp/contact_spec.rb +++ b/spec/epp/contact_spec.rb @@ -1,7 +1,6 @@ require 'rails_helper' describe 'EPP Contact', epp: true do - let(:server_gitlab) { Epp::Server.new({ server: 'localhost', tag: 'gitlab', password: 'ghyt9e4fu', port: 701 }) } let(:server_zone) { Epp::Server.new({ server: 'localhost', tag: 'zone', password: 'ghyt9e4fu', port: 701 }) } let(:server_elkdata) { Epp::Server.new({ server: 'localhost', tag: 'elkdata', password: 'ghyt9e4fu', port: 701 }) } let(:elkdata) { Fabricate(:registrar, { name: 'Elkdata', reg_no: '123' }) } @@ -9,7 +8,6 @@ describe 'EPP Contact', epp: true do context 'with valid user' do before(:each) do - Fabricate(:epp_user) Fabricate(:epp_user, username: 'zone', registrar: zone) Fabricate(:epp_user, username: 'elkdata', registrar: elkdata) Fabricate(:domain_validation_setting_group) @@ -175,7 +173,7 @@ describe 'EPP Contact', epp: true do end it 'fails if contact has associated domain' do - Fabricate(:domain, owner_contact: Fabricate(:contact, code: 'dwa1234', created_by_id: EppUser.first.id)) + Fabricate(:domain, owner_contact: Fabricate(:contact, code: 'dwa1234', created_by_id: EppUser.first.id), registrar: zone) expect(Domain.first.owner_contact.address.present?).to be true response = epp_request('contacts/delete.xml') diff --git a/spec/epp/domain_spec.rb b/spec/epp/domain_spec.rb index 86ab9e234..9ed8f7240 100644 --- a/spec/epp/domain_spec.rb +++ b/spec/epp/domain_spec.rb @@ -1,7 +1,6 @@ require 'rails_helper' describe 'EPP Domain', epp: true do - let(:server_gitlab) { Epp::Server.new({ server: 'localhost', tag: 'gitlab', password: 'ghyt9e4fu', port: 701 }) } let(:server_zone) { Epp::Server.new({ server: 'localhost', tag: 'zone', password: 'ghyt9e4fu', port: 701 }) } let(:server_elkdata) { Epp::Server.new({ server: 'localhost', tag: 'elkdata', password: 'ghyt9e4fu', port: 701 }) } let(:elkdata) { Fabricate(:registrar, { name: 'Elkdata', reg_no: '123' }) } @@ -9,7 +8,6 @@ describe 'EPP Domain', epp: true do context 'with valid user' do before(:each) do - Fabricate(:epp_user) Fabricate(:epp_user, username: 'zone', registrar: zone) Fabricate(:epp_user, username: 'elkdata', registrar: elkdata) @@ -171,9 +169,8 @@ describe 'EPP Domain', epp: true do it 'creates new pw after successful transfer' do pw = domain.auth_info xml = domain_transfer_xml(pw: pw) - epp_request(xml, :xml) # transfer domain - response = epp_request(xml, :xml) # attempt second transfer - + response = epp_request(xml, :xml, :elkdata) # transfer domain + response = epp_request(xml, :xml, :elkdata) # attempt second transfer expect(response[:result_code]).to eq('2200') expect(response[:msg]).to eq('Authentication error') end @@ -609,7 +606,7 @@ describe 'EPP Domain', epp: true do expect(domain.text).to eq('example.ee') expect(domain[:avail]).to eq('1') - Fabricate(:domain, name: 'example.ee') + Fabricate(:domain, name: 'example.ee', registrar: zone) response = epp_request(domain_check_xml, :xml) domain = response[:parsed].css('resData chkData cd').first diff --git a/spec/fabricators/country_fabricator.rb b/spec/fabricators/country_fabricator.rb index c37b578ce..d96c50f96 100644 --- a/spec/fabricators/country_fabricator.rb +++ b/spec/fabricators/country_fabricator.rb @@ -1,4 +1,4 @@ Fabricator(:country) do - iso Faker::Address.state_abbr - name Faker::Address.country + iso 'EE' + name 'Estonia' end diff --git a/spec/fabricators/registrar_fabricator.rb b/spec/fabricators/registrar_fabricator.rb index f2539774c..b2e9c6555 100644 --- a/spec/fabricators/registrar_fabricator.rb +++ b/spec/fabricators/registrar_fabricator.rb @@ -2,4 +2,5 @@ Fabricator(:registrar) do name 'Zone Media OÜ' reg_no '10577829' address 'Lõõtsa 2, Tallinna linn, Harju maakond, 11415' + country end diff --git a/spec/support/epp.rb b/spec/support/epp.rb index 1e2006b38..bde695846 100644 --- a/spec/support/epp.rb +++ b/spec/support/epp.rb @@ -5,9 +5,8 @@ module Epp # handles connection and login automatically def epp_request(data, *args) - server = server_gitlab + server = server_zone server = server_elkdata if args.include?(:elkdata) - server = server_zone if args.include?(:zone) return parse_response(server.request(data)) if args.include?(:xml) return parse_response(server.request(read_body(data)))