]> git.openstreetmap.org Git - rails.git/commitdiff
Fix warnings about tests with no assertions
authorTom Hughes <tom@compton.nu>
Wed, 4 Sep 2024 18:07:00 +0000 (19:07 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 17 Sep 2024 19:39:31 +0000 (20:39 +0100)
test/helpers/application_helper_test.rb
test/integration/user_creation_test.rb
test/system/history_test.rb

index 24d74c85f3b0ad5d1a06aaad93f8eaf6f4739e2d..524851e63fe74ee3879a15a3da22e431578f3cb7 100644 (file)
@@ -88,8 +88,4 @@ class ApplicationHelperTest < ActionView::TestCase
     date = friendly_date_ago(Time.now.utc - 4.months)
     assert_match %r{^<time title=".*">4 months ago</time>$}, date
   end
     date = friendly_date_ago(Time.now.utc - 4.months)
     assert_match %r{^<time title=".*">4 months ago</time>$}, date
   end
-
-  def test_body_class; end
-
-  def test_header_nav_link_class; end
 end
 end
index 1b0933d32b0f9c760f704ba707e49362cdc7f5ff..f75fde75e197be59b835632b71781f3cc7ab93ff 100644 (file)
@@ -171,13 +171,13 @@ class UserCreationTest < ActionDispatch::IntegrationTest
   end
 
   # Check that the user can successfully recover their password
   end
 
   # Check that the user can successfully recover their password
-  def test_lost_password_recovery_success
-    # Open the lost password form
-    # Submit the lost password form
-    # Check the e-mail
-    # Submit the reset password token
-    # Check that the password has changed, and the user can login
-  end
+  def test_lost_password_recovery_success
+  #   Open the lost password form
+  #   Submit the lost password form
+  #   Check the e-mail
+  #   Submit the reset password token
+  #   Check that the password has changed, and the user can login
+  end
 
   def test_user_create_redirect
     new_email = "redirect_tester@osm.org"
 
   def test_user_create_redirect
     new_email = "redirect_tester@osm.org"
index 335063db9f171cea45714b8b5737c4d236fecfaa..679f711b307fbcaf156f1e35f366c719983d5e91 100644 (file)
@@ -28,27 +28,29 @@ class HistoryTest < ApplicationSystemTestCase
       create_visible_changeset(user, "next-changeset")
     end
 
       create_visible_changeset(user, "next-changeset")
     end
 
-    visit "#{user_path(user)}/history"
-    changesets = find "div.changesets"
-    changesets.assert_text "bottom-changeset-in-batch-1"
-    changesets.assert_no_text "bottom-changeset-in-batch-2"
-    changesets.assert_no_text "first-changeset-in-history"
-    changesets.assert_selector "ol", :count => 1
-    changesets.assert_selector "li", :count => PAGE_SIZE
-
-    changesets.find(".changeset_more a.btn").click
-    changesets.assert_text "bottom-changeset-in-batch-1"
-    changesets.assert_text "bottom-changeset-in-batch-2"
-    changesets.assert_no_text "first-changeset-in-history"
-    changesets.assert_selector "ol", :count => 1
-    changesets.assert_selector "li", :count => 2 * PAGE_SIZE
-
-    changesets.find(".changeset_more a.btn").click
-    changesets.assert_text "bottom-changeset-in-batch-1"
-    changesets.assert_text "bottom-changeset-in-batch-2"
-    changesets.assert_text "first-changeset-in-history"
-    changesets.assert_selector "ol", :count => 1
-    changesets.assert_selector "li", :count => (2 * PAGE_SIZE) + 1
+    assert_nothing_raised do
+      visit "#{user_path(user)}/history"
+      changesets = find "div.changesets"
+      changesets.assert_text "bottom-changeset-in-batch-1"
+      changesets.assert_no_text "bottom-changeset-in-batch-2"
+      changesets.assert_no_text "first-changeset-in-history"
+      changesets.assert_selector "ol", :count => 1
+      changesets.assert_selector "li", :count => PAGE_SIZE
+
+      changesets.find(".changeset_more a.btn").click
+      changesets.assert_text "bottom-changeset-in-batch-1"
+      changesets.assert_text "bottom-changeset-in-batch-2"
+      changesets.assert_no_text "first-changeset-in-history"
+      changesets.assert_selector "ol", :count => 1
+      changesets.assert_selector "li", :count => 2 * PAGE_SIZE
+
+      changesets.find(".changeset_more a.btn").click
+      changesets.assert_text "bottom-changeset-in-batch-1"
+      changesets.assert_text "bottom-changeset-in-batch-2"
+      changesets.assert_text "first-changeset-in-history"
+      changesets.assert_selector "ol", :count => 1
+      changesets.assert_selector "li", :count => (2 * PAGE_SIZE) + 1
+    end
   end
 
   def create_visible_changeset(user, comment)
   end
 
   def create_visible_changeset(user, comment)