From ed778fcfe0e136ff9351b3f5870223f731db3043 Mon Sep 17 00:00:00 2001 From: Chris Eidhof Date: Thu, 6 Nov 2014 09:18:08 +0100 Subject: [PATCH] Added specs for the latlng property --- spec/lib/location_spec.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spec/lib/location_spec.rb b/spec/lib/location_spec.rb index ea42fa40..cf26ac23 100644 --- a/spec/lib/location_spec.rb +++ b/spec/lib/location_spec.rb @@ -30,6 +30,10 @@ describe Location do expect(location['lat']).to eq 2.0 end + it "has a convencience accessor for combined latitude and longitude" do + expect(location.latlng).to eq "2.0,3.0" + end + it "does not allow hash-style assignment" do expect { location[:lat] = 2.0 @@ -60,6 +64,7 @@ describe Location do '{{location.latitude}}' => '2.0', '{{location.lng}}' => '3.0', '{{location.longitude}}' => '3.0', + '{{location.latlng}}' => '2.0,3.0', }.each { |template, result| expect(Liquid::Template.parse(template).render('location' => location.to_liquid)).to eq(result), "expected #{template.inspect} to expand to #{result.inspect}"