]> git.openstreetmap.org Git - rails.git/commitdiff
Fix missing translation of Follow links on dashboard
authorAnton Khorev <tony29@yandex.ru>
Fri, 17 Jan 2025 02:09:05 +0000 (05:09 +0300)
committerAnton Khorev <tony29@yandex.ru>
Fri, 17 Jan 2025 02:09:05 +0000 (05:09 +0300)
app/views/dashboards/_contact.html.erb
test/system/dashboard_test.rb

index 0b3b42fb507e11e2318d6f44f5c391f0c488f04e..4547a2d7514f086a06fe95317d61caf92ebfbdc4 100644 (file)
@@ -38,7 +38,7 @@
           <% if current_user.friends_with?(contact) %>
             <%= link_to t("users.show.unfollow"), follow_path(:display_name => contact.display_name, :referer => request.fullpath), :method => :delete %>
           <% else %>
-            <%= link_to t("users.follow"), follow_path(:display_name => contact.display_name, :referer => request.fullpath), :method => :post %>
+            <%= link_to t("users.show.follow"), follow_path(:display_name => contact.display_name, :referer => request.fullpath), :method => :post %>
           <% end %>
         </li>
       </ul>
index 2ab4db5fa21c7222216673f21f4df31074fd4124..12d9609383104d22402dce2c07279703f3219b7c 100644 (file)
@@ -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