PageRenderTime 53ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/spec/whois/record/parser/responses/whois.sx/status_registered_spec.rb

http://github.com/weppos/whois
Ruby | 159 lines | 144 code | 5 blank | 10 comment | 3 complexity | 485a44a56615708a0ab8526bf9cfbfbe MD5 | raw file
Possible License(s): MIT
  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.sx/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.sx.rb'
  13. describe Whois::Record::Parser::WhoisSx, "status_registered.expected" do
  14. subject do
  15. file = fixture("responses", "whois.sx/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("WHOIS LEGAL STATEMENT AND TERMS & CONDITIONS\nThe WHOIS service offered by OpenRegistry and the access to the\nrecords in the OpenRegistry WHOIS database are provided for information\npurposes only. It allows persons to check whether a specific domain name\nis still available or not and to obtain information related to the\nregistration records of existing domain names. You are not authorized to\naccess or query our WHOIS database through the use of electronic\nprocesses that are high-volume and automated except as reasonably\nnecessary to register domain names or modify existing registrations.\n\nOpenRegistry cannot, under any circumstances, be held liable should the\nstored information prove to be wrong, incomplete or inaccurate in any sense.\n\nBy submitting a WHOIS query you agree not to use the information made\navailable to:\n- Allow, enable or otherwise support the transmission of unsolicited,\ncommercial advertising or other solicitations whether via email, telephone\nor otherwise;\n- Target advertising in any possible way;\n- Cause nuisance in any possible way to the registrants by sending (whether\nby automated, electronic processes capable of enabling high volumes or\nother possible means) messages to them.\n\nWithout prejudice to the above, it is explicitly forbidden to extract, copy\nand/or use or re-utilise in any form and by any means (electronically or\nnot) the whole or a quantitatively or qualitatively substantial part of the\ncontents of the WHOIS database without prior and explicit permission by\nOpenRegistry, nor in any attempt hereof, to apply automated, electronic\nprocesses to OpenRegistry (or its systems).\n\nBy submitting the query you agree that any reproduction and/or transmission\nof data for commercial purposes will always be considered as the extraction\nof a substantial part of the content of the WHOIS database. You also agree\nto abide by this policy and accept that OpenRegistry can take measures to\nlimit the use of its WHOIS services in order to protect the privacy of its\nregistrants and/or the integrity of the database. OpenRegistry reserves the\nright to restrict your access to the WHOIS database in its sole discretion\nto ensure operational stability. OpenRegistry may restrict or terminate your\naccess to the WHOIS database for failure to abide by these terms of use.\n\nOpenRegistry reserves the right to modify these terms at any time.")
  22. end
  23. end
  24. describe "#domain" do
  25. it do
  26. expect(subject.domain).to eq("whois.sx")
  27. end
  28. end
  29. describe "#domain_id" do
  30. it do
  31. expect(subject.domain_id).to eq("d5-sx")
  32. end
  33. end
  34. describe "#status" do
  35. it do
  36. expect(subject.status).to eq(:registered)
  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("2011-12-09 14:07:22 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("2012-08-29 11:36:37 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("2021-12-09 14:07:22 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(nil)
  71. expect(subject.registrar.name).to eq("SX Registry \"PROMOTIONAL\" Registrar")
  72. expect(subject.registrar.organization).to eq(nil)
  73. expect(subject.registrar.url).to eq(nil)
  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("C65")
  83. expect(subject.registrant_contacts[0].name).to eq("SX Registry SA administrator")
  84. expect(subject.registrant_contacts[0].organization).to eq("SX Registry SA")
  85. expect(subject.registrant_contacts[0].address).to eq("2, rue Léon Laval")
  86. expect(subject.registrant_contacts[0].city).to eq("Leudelange")
  87. expect(subject.registrant_contacts[0].zip).to eq("L3372")
  88. expect(subject.registrant_contacts[0].state).to eq(nil)
  89. expect(subject.registrant_contacts[0].country).to eq("LUXEMBOURG")
  90. expect(subject.registrant_contacts[0].country_code).to eq(nil)
  91. expect(subject.registrant_contacts[0].phone).to eq(nil)
  92. expect(subject.registrant_contacts[0].fax).to eq(nil)
  93. expect(subject.registrant_contacts[0].email).to eq("registry@registry.sx")
  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("C65")
  103. expect(subject.admin_contacts[0].name).to eq("SX Registry SA administrator")
  104. expect(subject.admin_contacts[0].organization).to eq("SX Registry SA")
  105. expect(subject.admin_contacts[0].address).to eq("2, rue Léon Laval")
  106. expect(subject.admin_contacts[0].city).to eq("Leudelange")
  107. expect(subject.admin_contacts[0].zip).to eq("L3372")
  108. expect(subject.admin_contacts[0].state).to eq(nil)
  109. expect(subject.admin_contacts[0].country).to eq("LUXEMBOURG")
  110. expect(subject.admin_contacts[0].country_code).to eq(nil)
  111. expect(subject.admin_contacts[0].phone).to eq(nil)
  112. expect(subject.admin_contacts[0].fax).to eq(nil)
  113. expect(subject.admin_contacts[0].email).to eq("registry@registry.sx")
  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("C65")
  123. expect(subject.technical_contacts[0].name).to eq("SX Registry SA administrator")
  124. expect(subject.technical_contacts[0].organization).to eq("SX Registry SA")
  125. expect(subject.technical_contacts[0].address).to eq("2, rue Léon Laval")
  126. expect(subject.technical_contacts[0].city).to eq("Leudelange")
  127. expect(subject.technical_contacts[0].zip).to eq("L3372")
  128. expect(subject.technical_contacts[0].state).to eq(nil)
  129. expect(subject.technical_contacts[0].country).to eq("LUXEMBOURG")
  130. expect(subject.technical_contacts[0].country_code).to eq(nil)
  131. expect(subject.technical_contacts[0].phone).to eq(nil)
  132. expect(subject.technical_contacts[0].fax).to eq(nil)
  133. expect(subject.technical_contacts[0].email).to eq("registry@registry.sx")
  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(3).items
  140. expect(subject.nameservers[0]).to be_a(Whois::Record::Nameserver)
  141. expect(subject.nameservers[0].name).to eq("a.ns.sx")
  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("b.ns.sx")
  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("c.ns.sx")
  150. expect(subject.nameservers[2].ipv4).to eq(nil)
  151. expect(subject.nameservers[2].ipv6).to eq(nil)
  152. end
  153. end
  154. end