Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
whois.ati.tn crashes when contact update is "None"
- Loading branch information
Showing
5 changed files
with
87 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
spec/fixtures/responses/whois.ati.tn/property_contact_updated_none.expected
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#registrant_contacts | ||
%s %CLASS{array} | ||
%s %SIZE{1} | ||
%s[0] %CLASS{contact} | ||
%s[0].type == Whois::Record::Contact::TYPE_REGISTRANT | ||
%s[0].name == "MAISON DE BIEN HOTELIERS ET EQ Farhat Riadh" | ||
%s[0].created_on %TIME{2013-12-13 20:00:57} | ||
%s[0].updated_on == nil |
34 changes: 34 additions & 0 deletions
34
spec/fixtures/responses/whois.ati.tn/property_contact_updated_none.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
All rights reserved. | ||
Copyright "Tunisian Internet Agency - http://whois.tn" | ||
|
||
Domain : equipements-pro.com.tn | ||
Acivated : 2013-12-13 22:15:08 | ||
Registrar : I-HOSTERS | ||
|
||
NameServers : ns.steerbook.com. [91.121.103.174] | ||
NameServers : dns.steerbook.com. [46.105.59.229] | ||
|
||
Owner Name : MAISON DE BIEN HOTELIERS ET EQ Farhat Riadh | ||
Owner Address : complexe commercial Boukris 2 rue Om Larayes | ||
Owner Tel : 98639096 | ||
Owner Fax : | ||
Owner Email : mbh@tunet.tn | ||
Owner Created : 2013-12-13 20:00:57 | ||
Owner Updated : None | ||
|
||
Admin. Name : MAISON DE BIEN HOTELIERS ET EQ Farhat Riadh | ||
Admin. Address : complexe commercial Boukris 2 rue Om Larayes | ||
Admin. Tel : 98639096 | ||
Admin. Fax : | ||
Admin. Email : mbh@tunet.tn | ||
Admin. Created : 2013-12-13 20:00:57 | ||
Admin. Updated : None | ||
|
||
Tech. Name : MAISON DE BIEN HOTELIERS ET EQ Farhat Riadh | ||
Tech. Address : complexe commercial Boukris 2 rue Om Larayes | ||
Tech. Tel : 98639096 | ||
Tech. Fax : | ||
Tech. Email : mbh@tunet.tn | ||
Tech. Created : 2013-12-13 20:00:57 | ||
Tech. Updated : None | ||
|
35 changes: 35 additions & 0 deletions
35
spec/whois/record/parser/responses/whois.ati.tn/property_contact_updated_none_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# encoding: utf-8 | ||
|
||
# This file is autogenerated. Do not edit it manually. | ||
# If you want change the content of this file, edit | ||
# | ||
# /spec/fixtures/responses/whois.ati.tn/property_contact_updated_none.expected | ||
# | ||
# and regenerate the tests with the following rake task | ||
# | ||
# $ rake spec:generate | ||
# | ||
|
||
require 'spec_helper' | ||
require 'whois/record/parser/whois.ati.tn.rb' | ||
|
||
describe Whois::Record::Parser::WhoisAtiTn, "property_contact_updated_none.expected" do | ||
|
||
subject do | ||
file = fixture("responses", "whois.ati.tn/property_contact_updated_none.txt") | ||
part = Whois::Record::Part.new(body: File.read(file)) | ||
described_class.new(part) | ||
end | ||
|
||
describe "#registrant_contacts" do | ||
it do | ||
expect(subject.registrant_contacts).to be_a(Array) | ||
expect(subject.registrant_contacts).to have(1).items | ||
expect(subject.registrant_contacts[0]).to be_a(Whois::Record::Contact) | ||
expect(subject.registrant_contacts[0].type).to eq(Whois::Record::Contact::TYPE_REGISTRANT) | ||
expect(subject.registrant_contacts[0].name).to eq("MAISON DE BIEN HOTELIERS ET EQ Farhat Riadh") | ||
expect(subject.registrant_contacts[0].created_on).to eq(Time.parse("2013-12-13 20:00:57")) | ||
expect(subject.registrant_contacts[0].updated_on).to eq(nil) | ||
end | ||
end | ||
end |