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

require 'spec_helper'

describe "whois.nic.ch", :aggregate_failures do

  subject do
    file = fixture("responses", "whois.nic.ch/ch/property_contacts.txt")
    part = Whois::Record::Part.new(body: File.read(file), host: "whois.nic.ch")
    Whois::Parser.parser_for(part)
  end

  it "matches property_contacts.expected" do
    expect(subject.registrant_contacts).to be_a(Array)
    expect(subject.registrant_contacts.size).to eq(1)
    expect(subject.registrant_contacts[0]).to be_a(Whois::Parser::Contact)
    expect(subject.registrant_contacts[0].name).to eq("EISD John")
    expect(subject.registrant_contacts[0].address).to eq("Room 208, Furong Road, Changsha City\nCN-41000 Changsha\nChina")
    expect(subject.technical_contacts).to be_a(Array)
    expect(subject.technical_contacts.size).to eq(1)
    expect(subject.technical_contacts[0]).to be_a(Whois::Parser::Contact)
    expect(subject.technical_contacts[0].name).to eq("xie huijie")
    expect(subject.technical_contacts[0].address).to eq("xie huijie\nNo95.Lane768.Ruili Road.Minhang District\nCN-200240 shanghai\nChina")
    expect { subject.admin_contacts }.to raise_error(Whois::AttributeNotSupported)
  end
end
