PageRenderTime 32ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/spec/whois/record/parser/responses/whois.verisign-grs.com/net/status_registered_spec.rb

https://gitlab.com/dandrews/whois
Ruby | 113 lines | 98 code | 5 blank | 10 comment | 0 complexity | 38cd1be6edf0ae9632f7cb4098267be3 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.verisign-grs.com/net/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.verisign-grs.com.rb'
  13. describe Whois::Record::Parser::WhoisVerisignGrsCom, "status_registered.expected" do
  14. subject do
  15. file = fixture("responses", "whois.verisign-grs.com/net/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("TERMS OF USE: You are not authorized to access or query our Whois database through the use of electronic processes that are high-volume and automated except as reasonably necessary to register domain names or modify existing registrations; the Data in VeriSign Global Registry Services' (\"VeriSign\") Whois database is provided by VeriSign for information purposes only, and to assist persons in obtaining information about or related to a domain name registration record. VeriSign does not guarantee its accuracy. By submitting a Whois query, you agree to abide by the following terms of use: You agree that you may use this Data only for lawful purposes and that under no circumstances will you use this Data to: (1) allow, enable, or otherwise support the transmission of mass unsolicited, commercial advertising or solicitations via e-mail, telephone, or facsimile; or (2) enable high volume, automated, electronic processes that apply to VeriSign (or its computer systems). The compilation, repackaging, dissemination or other use of this Data is expressly prohibited without the prior written consent of VeriSign. You agree not to use electronic processes that are automated and high-volume to access or query the Whois database except as reasonably necessary to register domain names or modify existing registrations. VeriSign reserves the right to restrict your access to the Whois database in its sole discretion to ensure operational stability. VeriSign may restrict or terminate your access to the Whois database for failure to abide by these terms of use. VeriSign 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("google.net")
  27. end
  28. end
  29. describe "#domain_id" do
  30. it do
  31. expect(subject.domain_id).to eq(nil)
  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("1999-03-15"))
  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-02-11"))
  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-03-15"))
  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("MARKMONITOR INC.")
  72. expect(subject.registrar.organization).to eq(nil)
  73. expect(subject.registrar.url).to eq("http://www.markmonitor.com")
  74. end
  75. end
  76. describe "#nameservers" do
  77. it do
  78. expect(subject.nameservers).to be_a(Array)
  79. expect(subject.nameservers).to have(4).items
  80. expect(subject.nameservers[0]).to be_a(Whois::Record::Nameserver)
  81. expect(subject.nameservers[0].name).to eq("ns1.google.com")
  82. expect(subject.nameservers[0].ipv4).to eq(nil)
  83. expect(subject.nameservers[0].ipv6).to eq(nil)
  84. expect(subject.nameservers[1]).to be_a(Whois::Record::Nameserver)
  85. expect(subject.nameservers[1].name).to eq("ns2.google.com")
  86. expect(subject.nameservers[1].ipv4).to eq(nil)
  87. expect(subject.nameservers[1].ipv6).to eq(nil)
  88. expect(subject.nameservers[2]).to be_a(Whois::Record::Nameserver)
  89. expect(subject.nameservers[2].name).to eq("ns3.google.com")
  90. expect(subject.nameservers[2].ipv4).to eq(nil)
  91. expect(subject.nameservers[2].ipv6).to eq(nil)
  92. expect(subject.nameservers[3]).to be_a(Whois::Record::Nameserver)
  93. expect(subject.nameservers[3].name).to eq("ns4.google.com")
  94. expect(subject.nameservers[3].ipv4).to eq(nil)
  95. expect(subject.nameservers[3].ipv6).to eq(nil)
  96. end
  97. end
  98. describe "#referral_whois" do
  99. it do
  100. expect(subject.referral_whois).to eq("whois.markmonitor.com")
  101. end
  102. end
  103. describe "#referral_url" do
  104. it do
  105. expect(subject.referral_url).to eq("http://www.markmonitor.com")
  106. end
  107. end
  108. end