display location as text on profile

This commit is contained in:
Skud
2013-02-12 11:56:56 +11:00
parent 879bf0ca2c
commit 8ded8eb0c3
3 changed files with 26 additions and 1 deletions

View File

@@ -9,7 +9,9 @@
%p
= "Member since: #{@member.created_at.to_s(:date)}"
%p
Location: Unknown
Location:
= @member.location
= "(#{@member.latitude}, #{@member.longitude})"
- if @member.show_email
%p
Email:

View File

@@ -27,6 +27,13 @@ FactoryGirl.define do
show_email true
end
factory :geolocated_member do
location 'Greenwich, UK'
# including lat/long explicitly because geocoder doesn't work with FG
latitude 51.483
longitude 0.004
end
end
end

View File

@@ -67,4 +67,20 @@ describe "members/show" do
end
end
context "geolocations" do
before(:each) do
@member = FactoryGirl.create(:geolocated_member)
render
end
it "shows the location" do
rendered.should contain @member.location
end
it "shows the latitude" do
rendered.should contain @member.latitude.to_s
end
it "shows the longitude" do
rendered.should contain @member.longitude.to_s
end
end
end