1 require "application_system_test_case"
3 class DashboardSystemTest < ApplicationSystemTestCase
4 test "show no users if have no friends" do
9 assert_text "You have not added any friends yet."
12 test "show users if have friends" do
13 user = create(:user, :home_lon => 1.1, :home_lat => 1.1)
14 friend_user = create(:user, :home_lon => 1.2, :home_lat => 1.2)
15 create(:friendship, :befriender => user, :befriendee => friend_user)
16 create(:changeset, :user => friend_user)
20 assert_no_text "You have not added any friends yet."
22 friends_heading = find :element, "h2", :text => "My friends"
23 others_heading = find :element, "h2", :text => "Other nearby users"
25 assert_link friend_user.display_name, :below => friends_heading, :above => others_heading