mirror of
https://github.com/Fishwaldo/huginn.git
synced 2025-03-15 19:31:26 +00:00
Added specs for the latlng property
This commit is contained in:
parent
c278edb686
commit
ed778fcfe0
1 changed files with 5 additions and 0 deletions
|
@ -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}"
|
||||
|
|
Loading…
Add table
Reference in a new issue