Sha256: d82991a6c3632b9015c9aa1d7c5746e63ee15fdb38bf739935d3dec29dba60a7

Contents?: true

Size: 1.11 KB

Versions: 2

Compression:

Stored size: 1.11 KB

Contents

require 'spec_helper'

describe Weather::Location, :vcr do
  it 'should contain city, country, and region as strings' do
    response = Weather.lookup 9848

    expect(response.location.city).to be_a String
    expect(response.location.city).to be_a String
    expect(response.location.region).to be_a String
    expect(response.location.country).to be_a String
  end

  it 'should be able to look up Seattle, WA' do
    response = Weather.lookup 2490383

    expect(response.location.city).to eq 'Seattle'
    expect(response.location.region).to eq 'WA'
    expect(response.location.country).to eq 'United States'
  end

  it 'should be able to look up Victoria, BC' do
    response = Weather.lookup 9848

    expect(response.location.city).to eq 'Victoria'
    expect(response.location.region).to eq 'BC'
    expect(response.location.country).to eq 'Canada'
  end

  it 'should be able to look up Nice, France' do
    response = Weather.lookup 614274

    expect(response.location.city).to eq 'Nice'
    expect(response.location.region).to eq "Provence-Alpes-Cote d'Azur"
    expect(response.location.country).to eq 'France'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
weather-api-1.4.0 spec/lib/location_spec.rb
weather-api-1.3.0 spec/lib/location_spec.rb