mirror of
https://github.com/internetee/registry.git
synced 2025-05-29 17:10:08 +02:00
Fix rubocop #2803
This commit is contained in:
parent
aecd61670a
commit
49845d1d0b
4 changed files with 29 additions and 13 deletions
|
@ -208,7 +208,7 @@ module Depp
|
||||||
authInfo: {
|
authInfo: {
|
||||||
pw: { value: password }
|
pw: { value: password }
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
extension_xml
|
extension_xml
|
||||||
)
|
)
|
||||||
|
|
|
@ -60,7 +60,10 @@ describe 'EPP Contact', epp: true do
|
||||||
it 'fails if request xml is missing' do
|
it 'fails if request xml is missing' do
|
||||||
response = epp_plain_request(@epp_xml.create)
|
response = epp_plain_request(@epp_xml.create)
|
||||||
|
|
||||||
response[:results][0][:msg].should == "Element '{https://epp.tld.ee/schema/contact-eis-1.0.xsd}create': Missing child element(s). Expected is one of ( {https://epp.tld.ee/schema/contact-eis-1.0.xsd}id, {https://epp.tld.ee/schema/contact-eis-1.0.xsd}postalInfo )."
|
response[:results][0][:msg].should ==
|
||||||
|
"Element '{https://epp.tld.ee/schema/contact-eis-1.0.xsd}create': Missing child element(s). "\
|
||||||
|
"Expected is one of ( {https://epp.tld.ee/schema/contact-eis-1.0.xsd}id, "\
|
||||||
|
"{https://epp.tld.ee/schema/contact-eis-1.0.xsd}postalInfo )."
|
||||||
response[:results][0][:result_code].should == '2001'
|
response[:results][0][:result_code].should == '2001'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -173,7 +176,9 @@ describe 'EPP Contact', epp: true do
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
response = create_request({}, extension)
|
response = create_request({}, extension)
|
||||||
response[:msg].should == "Element '{https://epp.tld.ee/schema/eis-1.0.xsd}ident', attribute 'cc': [facet 'maxLength'] The value 'WRONG' has a length of '5'; this exceeds the allowed maximum length of '2'."
|
response[:msg].should == "Element '{https://epp.tld.ee/schema/eis-1.0.xsd}ident', "\
|
||||||
|
"attribute 'cc': [facet 'maxLength'] The value 'WRONG' has a length of '5'; this exceeds "\
|
||||||
|
"the allowed maximum length of '2'."
|
||||||
response[:result_code].should == '2001'
|
response[:result_code].should == '2001'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -185,7 +190,8 @@ describe 'EPP Contact', epp: true do
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
response = create_request({}, extension)
|
response = create_request({}, extension)
|
||||||
response[:msg].should == "Element '{https://epp.tld.ee/schema/eis-1.0.xsd}ident': The attribute 'cc' is required but missing."
|
response[:msg].should == "Element '{https://epp.tld.ee/schema/eis-1.0.xsd}ident': The attribute "\
|
||||||
|
"'cc' is required but missing."
|
||||||
response[:result_code].should == '2001'
|
response[:result_code].should == '2001'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -196,7 +202,8 @@ describe 'EPP Contact', epp: true do
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
response = create_request({}, extension)
|
response = create_request({}, extension)
|
||||||
response[:msg].should == "Element '{https://epp.tld.ee/schema/eis-1.0.xsd}ident': The attribute 'type' is required but missing."
|
response[:msg].should == "Element '{https://epp.tld.ee/schema/eis-1.0.xsd}ident': The attribute "\
|
||||||
|
"'type' is required but missing."
|
||||||
response[:result_code].should == '2001'
|
response[:result_code].should == '2001'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -309,7 +316,9 @@ describe 'EPP Contact', epp: true do
|
||||||
|
|
||||||
it 'fails if request is invalid' do
|
it 'fails if request is invalid' do
|
||||||
response = epp_plain_request(@epp_xml.update)
|
response = epp_plain_request(@epp_xml.update)
|
||||||
response[:results][0][:msg].should == "Element '{https://epp.tld.ee/schema/contact-eis-1.0.xsd}update': Missing child element(s). Expected is ( {https://epp.tld.ee/schema/contact-eis-1.0.xsd}id )."
|
response[:results][0][:msg].should ==
|
||||||
|
"Element '{https://epp.tld.ee/schema/contact-eis-1.0.xsd}update': Missing child element(s). "\
|
||||||
|
"Expected is ( {https://epp.tld.ee/schema/contact-eis-1.0.xsd}id )."
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns error if obj doesnt exist' do
|
it 'returns error if obj doesnt exist' do
|
||||||
|
@ -398,7 +407,8 @@ describe 'EPP Contact', epp: true do
|
||||||
}, {}
|
}, {}
|
||||||
)
|
)
|
||||||
|
|
||||||
response[:msg].should == "Element '{https://epp.tld.ee/schema/contact-eis-1.0.xsd}id': This element is not expected."
|
response[:msg].should == "Element '{https://epp.tld.ee/schema/contact-eis-1.0.xsd}id': "\
|
||||||
|
"This element is not expected."
|
||||||
response[:result_code].should == '2001'
|
response[:result_code].should == '2001'
|
||||||
|
|
||||||
@contact.reload.code.should == 'FIRST0:SH8013'
|
@contact.reload.code.should == 'FIRST0:SH8013'
|
||||||
|
@ -719,7 +729,9 @@ describe 'EPP Contact', epp: true do
|
||||||
it 'fails if request is invalid' do
|
it 'fails if request is invalid' do
|
||||||
response = epp_plain_request(@epp_xml.delete)
|
response = epp_plain_request(@epp_xml.delete)
|
||||||
|
|
||||||
response[:results][0][:msg].should == "Element '{https://epp.tld.ee/schema/contact-eis-1.0.xsd}delete': Missing child element(s). Expected is ( {https://epp.tld.ee/schema/contact-eis-1.0.xsd}id )."
|
response[:results][0][:msg].should ==
|
||||||
|
"Element '{https://epp.tld.ee/schema/contact-eis-1.0.xsd}delete': Missing child element(s). "\
|
||||||
|
"Expected is ( {https://epp.tld.ee/schema/contact-eis-1.0.xsd}id )."
|
||||||
response[:results][0][:result_code].should == '2001'
|
response[:results][0][:result_code].should == '2001'
|
||||||
response[:results].count.should == 1
|
response[:results].count.should == 1
|
||||||
end
|
end
|
||||||
|
@ -814,7 +826,9 @@ describe 'EPP Contact', epp: true do
|
||||||
it 'fails if request is invalid' do
|
it 'fails if request is invalid' do
|
||||||
response = epp_plain_request(@epp_xml.check)
|
response = epp_plain_request(@epp_xml.check)
|
||||||
|
|
||||||
response[:results][0][:msg].should == "Element '{https://epp.tld.ee/schema/contact-eis-1.0.xsd}check': Missing child element(s). Expected is ( {https://epp.tld.ee/schema/contact-eis-1.0.xsd}id )."
|
response[:results][0][:msg].should ==
|
||||||
|
"Element '{https://epp.tld.ee/schema/contact-eis-1.0.xsd}check': Missing child element(s). "\
|
||||||
|
"Expected is ( {https://epp.tld.ee/schema/contact-eis-1.0.xsd}id )."
|
||||||
response[:results][0][:result_code].should == '2001'
|
response[:results][0][:result_code].should == '2001'
|
||||||
response[:results].count.should == 1
|
response[:results].count.should == 1
|
||||||
end
|
end
|
||||||
|
@ -868,7 +882,9 @@ describe 'EPP Contact', epp: true do
|
||||||
|
|
||||||
it 'fails if request invalid' do
|
it 'fails if request invalid' do
|
||||||
response = epp_plain_request(@epp_xml.info)
|
response = epp_plain_request(@epp_xml.info)
|
||||||
response[:results][0][:msg].should == "Element '{https://epp.tld.ee/schema/contact-eis-1.0.xsd}info': Missing child element(s). Expected is ( {https://epp.tld.ee/schema/contact-eis-1.0.xsd}id )."
|
response[:results][0][:msg].should ==
|
||||||
|
"Element '{https://epp.tld.ee/schema/contact-eis-1.0.xsd}info': Missing child element(s). "\
|
||||||
|
"Expected is ( {https://epp.tld.ee/schema/contact-eis-1.0.xsd}id )."
|
||||||
response[:results][0][:result_code].should == '2001'
|
response[:results][0][:result_code].should == '2001'
|
||||||
response[:results].count.should == 1
|
response[:results].count.should == 1
|
||||||
end
|
end
|
||||||
|
|
|
@ -2757,7 +2757,9 @@ describe 'EPP Domain', epp: true do
|
||||||
|
|
||||||
xml = domain_info_xml(name: { value: domain.name, attrs: { hosts: 'invalid' } })
|
xml = domain_info_xml(name: { value: domain.name, attrs: { hosts: 'invalid' } })
|
||||||
response = epp_plain_request(xml)
|
response = epp_plain_request(xml)
|
||||||
response[:msg].should == "Element '{https://epp.tld.ee/schema/domain-eis-1.0.xsd}name', attribute 'hosts': [facet 'enumeration'] The value 'invalid' is not an element of the set {'all', 'del', 'none', 'sub'}."
|
response[:msg].should == "Element '{https://epp.tld.ee/schema/domain-eis-1.0.xsd}name', "\
|
||||||
|
"attribute 'hosts': [facet 'enumeration'] The value 'invalid' is not an element of the "\
|
||||||
|
"set {'all', 'del', 'none', 'sub'}."
|
||||||
response[:result_code].should == '2001'
|
response[:result_code].should == '2001'
|
||||||
|
|
||||||
xml = domain_info_xml(name: { value: domain.name, attrs: { hosts: 'sub' } })
|
xml = domain_info_xml(name: { value: domain.name, attrs: { hosts: 'sub' } })
|
||||||
|
|
|
@ -4,7 +4,6 @@ describe 'EPP Helper', epp: true do
|
||||||
context 'in context of Domain' do
|
context 'in context of Domain' do
|
||||||
before(:all) { @uniq_no = proc { @i ||= 0; @i += 1 } }
|
before(:all) { @uniq_no = proc { @i ||= 0; @i += 1 } }
|
||||||
|
|
||||||
# rubocop: disable Metrics/LineLength
|
|
||||||
it 'generates valid transfer xml' do
|
it 'generates valid transfer xml' do
|
||||||
dn = next_domain_name
|
dn = next_domain_name
|
||||||
expected = Nokogiri::XML('<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
expected = Nokogiri::XML('<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
@ -54,6 +53,5 @@ describe 'EPP Helper', epp: true do
|
||||||
generated = Nokogiri::XML(xml).to_s.squish
|
generated = Nokogiri::XML(xml).to_s.squish
|
||||||
generated.should == expected
|
generated.should == expected
|
||||||
end
|
end
|
||||||
# rubocop: enable Metrics/LineLength
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue