Sha256: 2ded95175b0fcd4b3283ca69b5f30dedee35e88aad10b395bea22caa8cf0c8f7
Contents?: true
Size: 1.02 KB
Versions: 8
Compression:
Stored size: 1.02 KB
Contents
require_relative '../../spec_helper' describe Barometer::Query::Converter::FromShortZipcodeToZipcode do it "converts :short_zipcode -> :zipcode" do query = Barometer::Query.new('90210') converter = Barometer::Query::Converter::FromShortZipcodeToZipcode.new(query) converted_query = converter.call converted_query.q.should == '90210' converted_query.format.should == :zipcode end it "uses a previous coversion (if needed) on the query" do query = Barometer::Query.new('Beverly Hills, CA, United States') query.add_conversion(:short_zipcode, '90210') converter = Barometer::Query::Converter::FromShortZipcodeToZipcode.new(query) converted_query = converter.call converted_query.q.should == '90210' converted_query.format.should == :zipcode end it "does not convert any other format" do query = Barometer::Query.new('Beverly Hills, CA, United States') converter = Barometer::Query::Converter::FromShortZipcodeToZipcode.new(query) converter.call.should be_nil end end
Version data entries
8 entries across 8 versions & 1 rubygems