PageRenderTime 44ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/spec/whois/record/parser/responses/whois.nic.pw/status_registered_spec.rb

https://gitlab.com/dandrews/whois
Ruby | 175 lines | 160 code | 5 blank | 10 comment | 2 complexity | a5e0becd37fcc012f5ae3cea0f92bc30 MD5 | raw file
  1. # encoding: utf-8
  2. # This file is autogenerated. Do not edit it manually.
  3. # If you want change the content of this file, edit
  4. #
  5. # /spec/fixtures/responses/whois.nic.pw/status_registered.expected
  6. #
  7. # and regenerate the tests with the following rake task
  8. #
  9. # $ rake spec:generate
  10. #
  11. require 'spec_helper'
  12. require 'whois/record/parser/whois.nic.pw.rb'
  13. describe Whois::Record::Parser::WhoisNicPw, "status_registered.expected" do
  14. subject do
  15. file = fixture("responses", "whois.nic.pw/status_registered.txt")
  16. part = Whois::Record::Part.new(body: File.read(file))
  17. described_class.new(part)
  18. end
  19. describe "#disclaimer" do
  20. it do
  21. expect(subject.disclaimer).to eq("This whois service is provided by CentralNic Ltd and only contains information pertaining to Internet domain names we have registered for our customers. By using this service you are agreeing (1) not to use any information presented here for any purpose other than determining ownership of domain names, (2) not to store or reproduce this data in any way, (3) not to use any high-volume, automated, electronic processes to obtain data from this service. Abuse of this service is monitored and actions in contravention of these terms will result in being permanently blacklisted. All data is (c) CentralNic Ltd https://www.centralnic.com/")
  22. end
  23. end
  24. describe "#domain" do
  25. it do
  26. expect(subject.domain).to eq("google.pw")
  27. end
  28. end
  29. describe "#domain_id" do
  30. it do
  31. expect(subject.domain_id).to eq("CNIC-DO949924")
  32. end
  33. end
  34. describe "#status" do
  35. it do
  36. expect(subject.status).to eq(["clientTransferProhibited", "clientUpdateProhibited", "clientDeleteProhibited", "serverTransferProhibited"])
  37. end
  38. end
  39. describe "#available?" do
  40. it do
  41. expect(subject.available?).to eq(false)
  42. end
  43. end
  44. describe "#registered?" do
  45. it do
  46. expect(subject.registered?).to eq(true)
  47. end
  48. end
  49. describe "#created_on" do
  50. it do
  51. expect(subject.created_on).to be_a(Time)
  52. expect(subject.created_on).to eq(Time.parse("2012-10-12 10:19:46 UTC"))
  53. end
  54. end
  55. describe "#updated_on" do
  56. it do
  57. expect(subject.updated_on).to be_a(Time)
  58. expect(subject.updated_on).to eq(Time.parse("2014-01-18 00:13:36 UTC"))
  59. end
  60. end
  61. describe "#expires_on" do
  62. it do
  63. expect(subject.expires_on).to be_a(Time)
  64. expect(subject.expires_on).to eq(Time.parse("2017-02-10 23:59:59 UTC"))
  65. end
  66. end
  67. describe "#registrar" do
  68. it do
  69. expect(subject.registrar).to be_a(Whois::Record::Registrar)
  70. expect(subject.registrar.id).to eq("7061-EM")
  71. expect(subject.registrar.name).to eq(nil)
  72. expect(subject.registrar.organization).to eq("MarkMonitor, Inc.")
  73. expect(subject.registrar.url).to eq("http://www.markmonitor.com/")
  74. end
  75. end
  76. describe "#registrant_contacts" do
  77. it do
  78. expect(subject.registrant_contacts).to be_a(Array)
  79. expect(subject.registrant_contacts).to have(1).items
  80. expect(subject.registrant_contacts[0]).to be_a(Whois::Record::Contact)
  81. expect(subject.registrant_contacts[0].type).to eq(Whois::Record::Contact::TYPE_REGISTRANT)
  82. expect(subject.registrant_contacts[0].id).to eq("H2396041")
  83. expect(subject.registrant_contacts[0].name).to eq("DNS Admin - Google Inc")
  84. expect(subject.registrant_contacts[0].organization).to eq("Google Inc")
  85. expect(subject.registrant_contacts[0].address).to eq("1600 Amphitheatre Parkway")
  86. expect(subject.registrant_contacts[0].city).to eq("Mountain View")
  87. expect(subject.registrant_contacts[0].zip).to eq("94043")
  88. expect(subject.registrant_contacts[0].state).to eq("CA")
  89. expect(subject.registrant_contacts[0].country).to eq(nil)
  90. expect(subject.registrant_contacts[0].country_code).to eq("US")
  91. expect(subject.registrant_contacts[0].phone).to eq("+1.6502530000")
  92. expect(subject.registrant_contacts[0].fax).to eq("+1.6502530001")
  93. expect(subject.registrant_contacts[0].email).to eq("dns-admin@google.com")
  94. end
  95. end
  96. describe "#admin_contacts" do
  97. it do
  98. expect(subject.admin_contacts).to be_a(Array)
  99. expect(subject.admin_contacts).to have(1).items
  100. expect(subject.admin_contacts[0]).to be_a(Whois::Record::Contact)
  101. expect(subject.admin_contacts[0].type).to eq(Whois::Record::Contact::TYPE_ADMINISTRATIVE)
  102. expect(subject.admin_contacts[0].id).to eq("H2396041")
  103. expect(subject.admin_contacts[0].name).to eq("DNS Admin - Google Inc")
  104. expect(subject.admin_contacts[0].organization).to eq("Google Inc")
  105. expect(subject.admin_contacts[0].address).to eq("1600 Amphitheatre Parkway")
  106. expect(subject.admin_contacts[0].city).to eq("Mountain View")
  107. expect(subject.admin_contacts[0].zip).to eq("94043")
  108. expect(subject.admin_contacts[0].state).to eq("CA")
  109. expect(subject.admin_contacts[0].country).to eq(nil)
  110. expect(subject.admin_contacts[0].country_code).to eq("US")
  111. expect(subject.admin_contacts[0].phone).to eq("+1.6502530000")
  112. expect(subject.admin_contacts[0].fax).to eq("+1.6502530001")
  113. expect(subject.admin_contacts[0].email).to eq("dns-admin@google.com")
  114. end
  115. end
  116. describe "#technical_contacts" do
  117. it do
  118. expect(subject.technical_contacts).to be_a(Array)
  119. expect(subject.technical_contacts).to have(1).items
  120. expect(subject.technical_contacts[0]).to be_a(Whois::Record::Contact)
  121. expect(subject.technical_contacts[0].type).to eq(Whois::Record::Contact::TYPE_TECHNICAL)
  122. expect(subject.technical_contacts[0].id).to eq("H2396041")
  123. expect(subject.technical_contacts[0].name).to eq("DNS Admin - Google Inc")
  124. expect(subject.technical_contacts[0].organization).to eq("Google Inc")
  125. expect(subject.technical_contacts[0].address).to eq("1600 Amphitheatre Parkway")
  126. expect(subject.technical_contacts[0].city).to eq("Mountain View")
  127. expect(subject.technical_contacts[0].zip).to eq("94043")
  128. expect(subject.technical_contacts[0].state).to eq("CA")
  129. expect(subject.technical_contacts[0].country).to eq(nil)
  130. expect(subject.technical_contacts[0].country_code).to eq("US")
  131. expect(subject.technical_contacts[0].phone).to eq("+1.6502530000")
  132. expect(subject.technical_contacts[0].fax).to eq("+1.6502530001")
  133. expect(subject.technical_contacts[0].email).to eq("dns-admin@google.com")
  134. end
  135. end
  136. describe "#nameservers" do
  137. it do
  138. expect(subject.nameservers).to be_a(Array)
  139. expect(subject.nameservers).to have(7).items
  140. expect(subject.nameservers[0]).to be_a(Whois::Record::Nameserver)
  141. expect(subject.nameservers[0].name).to eq("ns1.markmonitor.com")
  142. expect(subject.nameservers[0].ipv4).to eq(nil)
  143. expect(subject.nameservers[0].ipv6).to eq(nil)
  144. expect(subject.nameservers[1]).to be_a(Whois::Record::Nameserver)
  145. expect(subject.nameservers[1].name).to eq("ns2.markmonitor.com")
  146. expect(subject.nameservers[1].ipv4).to eq(nil)
  147. expect(subject.nameservers[1].ipv6).to eq(nil)
  148. expect(subject.nameservers[2]).to be_a(Whois::Record::Nameserver)
  149. expect(subject.nameservers[2].name).to eq("ns3.markmonitor.com")
  150. expect(subject.nameservers[2].ipv4).to eq(nil)
  151. expect(subject.nameservers[2].ipv6).to eq(nil)
  152. expect(subject.nameservers[3]).to be_a(Whois::Record::Nameserver)
  153. expect(subject.nameservers[3].name).to eq("ns4.markmonitor.com")
  154. expect(subject.nameservers[3].ipv4).to eq(nil)
  155. expect(subject.nameservers[3].ipv6).to eq(nil)
  156. expect(subject.nameservers[4]).to be_a(Whois::Record::Nameserver)
  157. expect(subject.nameservers[4].name).to eq("ns5.markmonitor.com")
  158. expect(subject.nameservers[4].ipv4).to eq(nil)
  159. expect(subject.nameservers[4].ipv6).to eq(nil)
  160. expect(subject.nameservers[5]).to be_a(Whois::Record::Nameserver)
  161. expect(subject.nameservers[5].name).to eq("ns6.markmonitor.com")
  162. expect(subject.nameservers[5].ipv4).to eq(nil)
  163. expect(subject.nameservers[5].ipv6).to eq(nil)
  164. expect(subject.nameservers[6]).to be_a(Whois::Record::Nameserver)
  165. expect(subject.nameservers[6].name).to eq("ns7.markmonitor.com")
  166. expect(subject.nameservers[6].ipv4).to eq(nil)
  167. expect(subject.nameservers[6].ipv6).to eq(nil)
  168. end
  169. end
  170. end