# 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.godaddy.com/status_registered.expected
#
# and regenerate the tests with the following rake task
#
#   $ rake spec:generate
#

require 'spec_helper'
require 'whois/record/parser/whois.godaddy.com.rb'

describe Whois::Record::Parser::WhoisGodaddyCom, "status_registered.expected" do

  subject do
    file = fixture("responses", "whois.godaddy.com/status_registered.txt")
    part = Whois::Record::Part.new(:body => File.read(file))
    described_class.new(part)
  end

  describe "#status" do
    it do
      lambda { subject.status }.should raise_error(Whois::AttributeNotSupported)
    end
  end
  describe "#available?" do
    it do
      subject.available?.should == false
    end
  end
  describe "#registered?" do
    it do
      subject.registered?.should == true
    end
  end
  describe "#registrar" do
    it do
      subject.registrar.should be_a(Whois::Record::Registrar)
      subject.registrar.id.should           == nil
      subject.registrar.name.should         == "Go Daddy"
      subject.registrar.url.should          == "http://www.godaddy.com/"
    end
  end
  describe "#registrant_contacts" do
    it do
      subject.registrant_contacts.should be_a(Array)
      subject.registrant_contacts.should have(1).items
      subject.registrant_contacts[0].should be_a(Whois::Record::Contact)
      subject.registrant_contacts[0].type.should         == Whois::Record::Contact::TYPE_REGISTRANT
      subject.registrant_contacts[0].name.should         == "Go Daddy"
      subject.registrant_contacts[0].organization.should == ""
      subject.registrant_contacts[0].address.should      == "14455 N Hayden Rd Suite 219"
      subject.registrant_contacts[0].city.should         == "Scottsdale"
      subject.registrant_contacts[0].zip.should          == "85260"
      subject.registrant_contacts[0].state.should        == "Arizona"
      subject.registrant_contacts[0].country.should      == "United States"
      subject.registrant_contacts[0].phone.should        == nil
      subject.registrant_contacts[0].fax.should          == nil
      subject.registrant_contacts[0].email.should        == nil
    end
  end
  describe "#admin_contacts" do
    it do
      subject.admin_contacts.should be_a(Array)
      subject.admin_contacts.should have(1).items
      subject.admin_contacts[0].should be_a(Whois::Record::Contact)
      subject.admin_contacts[0].type.should         == Whois::Record::Contact::TYPE_ADMIN
      subject.admin_contacts[0].name.should         == "Go Daddy, Go Daddy"
      subject.admin_contacts[0].organization.should == "Go Daddy"
      subject.admin_contacts[0].address.should      == "14455 N Hayden Rd Suite 219"
      subject.admin_contacts[0].city.should         == "Scottsdale"
      subject.admin_contacts[0].zip.should          == "85260"
      subject.admin_contacts[0].state.should        == "Arizona"
      subject.admin_contacts[0].country.should      == "United States"
      subject.admin_contacts[0].phone.should        == "+1.4805058800"
      subject.admin_contacts[0].fax.should          == "+1.4805058844"
      subject.admin_contacts[0].email.should        == "dns@jomax.net"
    end
  end
  describe "#technical_contacts" do
    it do
      subject.technical_contacts.should be_a(Array)
      subject.technical_contacts.should have(1).items
      subject.technical_contacts[0].should be_a(Whois::Record::Contact)
      subject.technical_contacts[0].type.should         == Whois::Record::Contact::TYPE_TECHNICAL
      subject.technical_contacts[0].name.should         == "Go Daddy, Go Daddy"
      subject.technical_contacts[0].organization.should == "Go Daddy"
      subject.technical_contacts[0].address.should      == "14455 N Hayden Rd Suite 219"
      subject.technical_contacts[0].city.should         == "Scottsdale"
      subject.technical_contacts[0].zip.should          == "85260"
      subject.technical_contacts[0].state.should        == "Arizona"
      subject.technical_contacts[0].country.should      == "United States"
      subject.technical_contacts[0].phone.should        == "+1.4805058800"
      subject.technical_contacts[0].fax.should          == "+1.4805058844"
      subject.technical_contacts[0].email.should        == "dns@jomax.net"
    end
  end
  describe "#nameservers" do
    it do
      subject.nameservers.should be_a(Array)
      subject.nameservers.should have(3).items
      subject.nameservers[0].should be_a(Whois::Record::Nameserver)
      subject.nameservers[0].name.should == "CNS1.SECURESERVER.NET"
      subject.nameservers[1].should be_a(Whois::Record::Nameserver)
      subject.nameservers[1].name.should == "CNS2.SECURESERVER.NET"
      subject.nameservers[2].should be_a(Whois::Record::Nameserver)
      subject.nameservers[2].name.should == "CNS3.SECURESERVER.NET"
    end
  end
end
