PageRenderTime 41ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/spec/whois/record/parser/responses/whois.centralnic.com/eu.com/status_registered_spec.rb

https://gitlab.com/dandrews/whois
Ruby | 161 lines | 146 code | 5 blank | 10 comment | 2 complexity | 77e374cf407e38c01abe5b4200cd381a 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.centralnic.com/eu.com/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.centralnic.com.rb'
  13. describe Whois::Record::Parser::WhoisCentralnicCom, "status_registered.expected" do
  14. subject do
  15. file = fixture("responses", "whois.centralnic.com/eu.com/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("walkabout.eu.com")
  27. end
  28. end
  29. describe "#domain_id" do
  30. it do
  31. expect(subject.domain_id).to eq("CNIC-DO85080")
  32. end
  33. end
  34. describe "#status" do
  35. it do
  36. expect(subject.status).to eq(["ok"])
  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("2001-08-14 10:14:41 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("2013-08-15 11:25:43 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("2015-08-14 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("H126914")
  71. expect(subject.registrar.name).to eq(nil)
  72. expect(subject.registrar.organization).to eq("iTransact Ltd")
  73. expect(subject.registrar.url).to eq("www.itransact.ltd.uk")
  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("H1045382")
  83. expect(subject.registrant_contacts[0].name).to eq("Regent Inns Plc")
  84. expect(subject.registrant_contacts[0].organization).to eq(nil)
  85. expect(subject.registrant_contacts[0].address).to eq("77 Muswell Hill\nLondon")
  86. expect(subject.registrant_contacts[0].city).to eq(nil)
  87. expect(subject.registrant_contacts[0].zip).to eq("N10 3PJ")
  88. expect(subject.registrant_contacts[0].state).to eq(nil)
  89. expect(subject.registrant_contacts[0].country).to eq(nil)
  90. expect(subject.registrant_contacts[0].country_code).to eq("GB")
  91. expect(subject.registrant_contacts[0].phone).to eq("+44.2083753155")
  92. expect(subject.registrant_contacts[0].fax).to eq("+44.2083753001")
  93. expect(subject.registrant_contacts[0].email).to eq("john.boyle@regent-inns.plc.uk")
  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("H64717")
  103. expect(subject.admin_contacts[0].name).to eq("John Boyle")
  104. expect(subject.admin_contacts[0].organization).to eq("Regent Inns Plc")
  105. expect(subject.admin_contacts[0].address).to eq("77 Muswell Hill\nLondon")
  106. expect(subject.admin_contacts[0].city).to eq(nil)
  107. expect(subject.admin_contacts[0].zip).to eq("N10 3PJ")
  108. expect(subject.admin_contacts[0].state).to eq(nil)
  109. expect(subject.admin_contacts[0].country).to eq(nil)
  110. expect(subject.admin_contacts[0].country_code).to eq("GB")
  111. expect(subject.admin_contacts[0].phone).to eq("+44.2083753155")
  112. expect(subject.admin_contacts[0].fax).to eq("+44.2083753001")
  113. expect(subject.admin_contacts[0].email).to eq("john.boyle@regent-inns.plc.uk")
  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("H126914")
  123. expect(subject.technical_contacts[0].name).to eq("Constantine Pagonis")
  124. expect(subject.technical_contacts[0].organization).to eq("iTransact Ltd")
  125. expect(subject.technical_contacts[0].address).to eq("PO Box 430\nCambridge\nCambs")
  126. expect(subject.technical_contacts[0].city).to eq(nil)
  127. expect(subject.technical_contacts[0].zip).to eq("CB1 2WE")
  128. expect(subject.technical_contacts[0].state).to eq(nil)
  129. expect(subject.technical_contacts[0].country).to eq(nil)
  130. expect(subject.technical_contacts[0].country_code).to eq("GB")
  131. expect(subject.technical_contacts[0].phone).to eq("+44.1223700322")
  132. expect(subject.technical_contacts[0].fax).to eq(nil)
  133. expect(subject.technical_contacts[0].email).to eq("constantine@itransact.ltd.uk")
  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(4).items
  140. expect(subject.nameservers[0]).to be_a(Whois::Record::Nameserver)
  141. expect(subject.nameservers[0].name).to eq("ns-1146.awsdns-15.org")
  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("ns-1741.awsdns-25.co.uk")
  146. expect(subject.nameservers[1].ipv4).to eq(nil)
  147. expect(subject.nameservers[1].ipv6).to eq(nil)
  148. expect(subject.nameservers[2].name).to eq("ns-374.awsdns-46.com")
  149. expect(subject.nameservers[2].ipv4).to eq(nil)
  150. expect(subject.nameservers[2].ipv6).to eq(nil)
  151. expect(subject.nameservers[3].name).to eq("ns-914.awsdns-50.net")
  152. expect(subject.nameservers[3].ipv4).to eq(nil)
  153. expect(subject.nameservers[3].ipv6).to eq(nil)
  154. end
  155. end
  156. end