Sha256: b2f69421465862a639edf803a0fcda340e87605c924f29c7ca38cbeb6f04f789

Contents?: true

Size: 760 Bytes

Versions: 5

Compression:

Stored size: 760 Bytes

Contents

require_relative '../../spec_helper'

module Barometer::WeatherService
  describe WeatherBug::ForecastResponse do
    let(:current_response) { Barometer::Response.new }

    it "parses the timezones correctly" do
      current_response.timezone = Barometer::Data::Zone.new('PDT')

      payload = Barometer::Utils::Payload.new({
        "@date" => "4/13/2013 10:23:00 AM",
        "forecast" => [{"high" => "13"}]
      })
      response = WeatherBug::ForecastResponse.new(current_response).parse(payload)

      utc_starts_at = Time.utc(2013,4,13,7,0,0)
      utc_ends_at = Time.utc(2013,4,14,6,59,59)

      expect( response.forecast[0].starts_at.utc ).to eq utc_starts_at
      expect( response.forecast[0].ends_at.utc ).to eq utc_ends_at
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
barometer-0.9.4 spec/weather_services/weather_bug/forecast_response_spec.rb
barometer-0.9.3 spec/weather_services/weather_bug/forecast_response_spec.rb
barometer-0.9.2 spec/weather_services/weather_bug/forecast_response_spec.rb
barometer-0.9.1 spec/weather_services/weather_bug/forecast_response_spec.rb
barometer-0.9.0 spec/weather_services/weather_bug/forecast_response_spec.rb