/
status_registered_spec.rb
154 lines (149 loc) · 6.4 KB
/
status_registered_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# 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.udag.net/status_registered.expected
#
# and regenerate the tests with the following rake task
#
# $ rake spec:generate
#
require 'spec_helper'
require 'whois/record/parser/whois.udag.net.rb'
describe Whois::Record::Parser::WhoisUdagNet, "status_registered.expected" do
subject do
file = fixture("responses", "whois.udag.net/status_registered.txt")
part = Whois::Record::Part.new(body: File.read(file))
described_class.new(part)
end
describe "#domain" do
it do
expect(subject.domain).to eq("udag.net")
end
end
describe "#domain_id" do
it do
expect(subject.domain_id).to eq("59973274_DOMAIN_NET-VRSN")
end
end
describe "#status" do
it do
expect(subject.status).to eq(:registered)
end
end
describe "#available?" do
it do
expect(subject.available?).to eq(false)
end
end
describe "#registered?" do
it do
expect(subject.registered?).to eq(true)
end
end
describe "#created_on" do
it do
expect(subject.created_on).to be_a(Time)
expect(subject.created_on).to eq(Time.parse("2001-02-11T20:15:57Z"))
end
end
describe "#updated_on" do
it do
expect(subject.updated_on).to be_a(Time)
expect(subject.updated_on).to eq(Time.parse("2013-02-12T08:40:19Z"))
end
end
describe "#expires_on" do
it do
expect(subject.expires_on).to be_a(Time)
expect(subject.expires_on).to eq(Time.parse("2014-02-11T20:15:57Z"))
end
end
describe "#registrar" do
it do
expect(subject.registrar).to be_a(Whois::Record::Registrar)
expect(subject.registrar.id).to eq("1408")
expect(subject.registrar.name).to eq("united domains AG")
expect(subject.registrar.organization).to eq("united domains AG")
expect(subject.registrar.url).to eq("http://www.united-domains.de/")
end
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].id).to eq(nil)
expect(subject.registrant_contacts[0].name).to eq("Host Master")
expect(subject.registrant_contacts[0].organization).to eq("united-domains AG")
expect(subject.registrant_contacts[0].address).to eq("Gautinger Str. 10")
expect(subject.registrant_contacts[0].city).to eq("Starnberg")
expect(subject.registrant_contacts[0].zip).to eq("82319")
expect(subject.registrant_contacts[0].state).to eq("Bayern")
expect(subject.registrant_contacts[0].country).to eq(nil)
expect(subject.registrant_contacts[0].country_code).to eq("DE")
expect(subject.registrant_contacts[0].phone).to eq("+49.8151368670")
expect(subject.registrant_contacts[0].fax).to eq("+49.81513686777")
expect(subject.registrant_contacts[0].email).to eq("hostmaster@united-domains.de")
expect(subject.registrant_contacts[0].created_on).to eq(nil)
expect(subject.registrant_contacts[0].updated_on).to eq(nil)
end
end
describe "#admin_contacts" do
it do
expect(subject.admin_contacts).to be_a(Array)
expect(subject.admin_contacts).to have(1).items
expect(subject.admin_contacts[0]).to be_a(Whois::Record::Contact)
expect(subject.admin_contacts[0].type).to eq(Whois::Record::Contact::TYPE_ADMINISTRATIVE)
expect(subject.admin_contacts[0].id).to eq(nil)
expect(subject.admin_contacts[0].name).to eq("Hostmaster Hostmaster")
expect(subject.admin_contacts[0].organization).to eq("united-domains AG")
expect(subject.admin_contacts[0].address).to eq("Gautinger Strasse 10")
expect(subject.admin_contacts[0].city).to eq("Starnberg")
expect(subject.admin_contacts[0].zip).to eq("82319")
expect(subject.admin_contacts[0].state).to eq("DE")
expect(subject.admin_contacts[0].country).to eq(nil)
expect(subject.admin_contacts[0].country_code).to eq("DE")
expect(subject.admin_contacts[0].phone).to eq("+49.8151368670")
expect(subject.admin_contacts[0].fax).to eq("+49.81513686777")
expect(subject.admin_contacts[0].email).to eq("hostmaster@united-domains.de")
expect(subject.admin_contacts[0].created_on).to eq(nil)
expect(subject.admin_contacts[0].updated_on).to eq(nil)
end
end
describe "#technical_contacts" do
it do
expect(subject.technical_contacts).to be_a(Array)
expect(subject.technical_contacts).to have(1).items
expect(subject.technical_contacts[0]).to be_a(Whois::Record::Contact)
expect(subject.technical_contacts[0].type).to eq(Whois::Record::Contact::TYPE_TECHNICAL)
expect(subject.technical_contacts[0].id).to eq(nil)
expect(subject.technical_contacts[0].name).to eq("Host Master")
expect(subject.technical_contacts[0].organization).to eq("united-domains AG")
expect(subject.technical_contacts[0].address).to eq("Gautinger Str. 10")
expect(subject.technical_contacts[0].city).to eq("Starnberg")
expect(subject.technical_contacts[0].zip).to eq("82319")
expect(subject.technical_contacts[0].state).to eq("Bayern")
expect(subject.technical_contacts[0].country).to eq(nil)
expect(subject.technical_contacts[0].country_code).to eq("DE")
expect(subject.technical_contacts[0].phone).to eq("+49.8151368670")
expect(subject.technical_contacts[0].fax).to eq("+49.81513686777")
expect(subject.technical_contacts[0].email).to eq("hostmaster@united-domains.de")
expect(subject.technical_contacts[0].created_on).to eq(nil)
expect(subject.technical_contacts[0].updated_on).to eq(nil)
end
end
describe "#nameservers" do
it do
expect(subject.nameservers).to be_a(Array)
expect(subject.nameservers).to have(3).items
expect(subject.nameservers[0]).to be_a(Whois::Record::Nameserver)
expect(subject.nameservers[0].name).to eq("ns1.udagdns.com")
expect(subject.nameservers[1]).to be_a(Whois::Record::Nameserver)
expect(subject.nameservers[1].name).to eq("ns2.udagdns.com")
expect(subject.nameservers[2]).to be_a(Whois::Record::Nameserver)
expect(subject.nameservers[2].name).to eq("ns3.udagdns.com")
end
end
end