This commit is contained in:
Martin Lensment 2015-07-14 12:04:08 +03:00
parent b18960c32a
commit bfe9086ec0
3 changed files with 5 additions and 3 deletions

View file

@ -24,7 +24,8 @@ class Epp::DomainsController < EppController
authorize! :create, Epp::Domain
@domain = Epp::Domain.new_from_epp(params[:parsed_frame], current_user)
handle_errors(@domain) and return if @domain.errors.any?
handle_errors(@domain) and return if @domain.valid? && @domain.errors.any?
@domain.valid?
handle_errors(@domain) and return if @domain.errors.any?
handle_errors and return unless balance_ok?('create')

View file

@ -13,7 +13,7 @@ class Epp::SessionsController < EppController
success = true
@api_user = ApiUser.find_by(login_params)
if request.ip == ENV['webclient_ip'] && (!Rails.env.test? || !Rails.env.development?)
if request.ip == ENV['webclient_ip'] && !Rails.env.test? && !Rails.env.development?
client_md5 = Certificate.parse_md_from_string(request.env['HTTP_SSL_CLIENT_CERT'])
server_md5 = Certificate.parse_md_from_string(File.read(ENV['cert_path']))
if client_md5 != server_md5

View file

@ -272,8 +272,9 @@ describe 'EPP Domain', epp: true do
xml = domain_create_xml(name: { value: 'ftp.ee' })
response = epp_plain_request(xml)
response[:result_code].should == '2302'
response[:msg].should == 'Domain name is blocked [name_dirty]'
response[:result_code].should == '2302'
response[:results][0][:value].should == 'ftp.ee'
response[:clTRID].should == 'ABC-12345'
end