X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/3eccf65d8cf2ceb13050f5c8d1396546631994be..5eb4c7c0d167f8a81d4b328c0ac4641ec2b61740:/test/system/dashboard_test.rb diff --git a/test/system/dashboard_test.rb b/test/system/dashboard_test.rb index 2ab4db5fa..12d960938 100644 --- a/test/system/dashboard_test.rb +++ b/test/system/dashboard_test.rb @@ -24,4 +24,29 @@ class DashboardSystemTest < ApplicationSystemTestCase assert_link friend_user.display_name, :below => friends_heading, :above => others_heading end + + test "show nearby users with ability to follow" do + user = create(:user, :home_lon => 1.1, :home_lat => 1.1) + nearby_user = create(:user, :home_lon => 1.2, :home_lat => 1.2) + sign_in_as(user) + + visit dashboard_path + + within_content_body do + others_nearby_heading = find :element, "h2", :text => "Other nearby users" + + assert_no_text "There are no other users who admit to mapping nearby yet" + assert_link nearby_user.display_name, :below => others_nearby_heading + assert_link "Follow", :below => others_nearby_heading + + click_on "Follow" + + followings_heading = find :element, "h2", :text => "Followings" + others_nearby_heading = find :element, "h2", :text => "Other nearby users" + + assert_text "There are no other users who admit to mapping nearby yet" + assert_link nearby_user.display_name, :below => followings_heading, :above => others_nearby_heading + assert_link "Unfollow", :below => followings_heading, :above => others_nearby_heading + end + end end