Added specs for the latlng property

This commit is contained in:
Chris Eidhof 2014-11-06 09:18:08 +01:00
parent c278edb686
commit ed778fcfe0

View file

@ -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}"