Sha256: 3d904f9160eb53763d26c7bb4dafeecbfb3e5a8519a610cc23e27b8697230169

Contents?: true

Size: 992 Bytes

Versions: 1

Compression:

Stored size: 992 Bytes

Contents

# encoding: utf-8
# frozen_string_literal: true
require 'spec_helper'
require 'contact-data'

describe ContactData::Link do
  let(:url) { 'http://iana.org' }

  it 'gets latest links with related slug' do
    VCR.use_cassette('links_latest') do
      result = ContactData::Link.latest verbose: true, since: '2014-07-28 12:12:20 +0100'
      expect(result).to be_an(Array)
    end
  end

  it 'gets metadata about a url' do
    VCR.use_cassette('links_info_search') do
      result = ContactData::Link.search url: url, verbose: true
      expect(result).to be_a(Hash)
    end
  end

  it 'gets metadata about a url when passed a url as a string' do
    VCR.use_cassette('links_info_search') do
      result = ContactData::Link.search url
      expect(result).to be_a(Hash)
    end
  end

  it 'gets metadata & contact from a url' do
    VCR.use_cassette('links_info_search') do
      result = ContactData::Link.info url: url, verbose: true
      expect(result).to be_a(Hash)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
contact-data-0.4.10 spec/contact-data_link_spec.rb