spec/query_spec.rb in attack-barometer-0.5.0 vs spec/query_spec.rb in attack-barometer-0.6.0

- old
+ new

@@ -21,10 +21,11 @@ @geocode_to_weather_id = "USNY0996" @coordinates_to_geocode = "New York, NY, USA" @coordinates_to_weather_id = "USNY0996" @icao_to_coordinates = "37.615223,-122.389979" @icao_to_geocode = "San Francisco Airport, USA" + @icao_to_weather_id = "USCA0987" Barometer.google_geocode_key = nil #Barometer.skip_graticule = true end @@ -133,10 +134,18 @@ it "responds to geo" do @query.geo.should be_nil end + it "responds to timezone" do + @query.timezone.should be_nil + end + + it "responds to conversions" do + @query.conversions.should be_nil + end + end describe "when returning the query to a Weather API" do it "raises an error if there are NO acceptable formats" do @@ -369,13 +378,14 @@ acceptable_formats = [:short_zipcode] query = @query.convert!(acceptable_formats) query.should be_nil end - it "skips converting to weather_id" do + it "converts to weather_id" do acceptable_formats = [:weather_id] query = @query.convert!(acceptable_formats) - query.should be_nil + query.q.should == @icao_to_weather_id + query.country_code.should == "US" end it "skips converting to zipcode" do acceptable_formats = [:zipcode] query = @query.convert!(acceptable_formats) \ No newline at end of file