From 60c1ae79d6c56f3e6d892043dc0f9681ae8cfa92 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 4 Sep 2024 19:07:00 +0100 Subject: [PATCH] Fix warnings about tests with no assertions --- test/helpers/application_helper_test.rb | 4 --- test/integration/user_creation_test.rb | 14 ++++---- test/system/history_test.rb | 44 +++++++++++++------------ 3 files changed, 30 insertions(+), 32 deletions(-) diff --git a/test/helpers/application_helper_test.rb b/test/helpers/application_helper_test.rb index 24d74c85f3..524851e63f 100644 --- a/test/helpers/application_helper_test.rb +++ b/test/helpers/application_helper_test.rb @@ -88,8 +88,4 @@ def test_friendly_date_ago date = friendly_date_ago(Time.now.utc - 4.months) assert_match %r{^$}, date end - - def test_body_class; end - - def test_header_nav_link_class; end end diff --git a/test/integration/user_creation_test.rb b/test/integration/user_creation_test.rb index 1b0933d32b..f75fde75e1 100644 --- a/test/integration/user_creation_test.rb +++ b/test/integration/user_creation_test.rb @@ -171,13 +171,13 @@ def test_user_create_success 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" diff --git a/test/system/history_test.rb b/test/system/history_test.rb index 335063db9f..679f711b30 100644 --- a/test/system/history_test.rb +++ b/test/system/history_test.rb @@ -28,27 +28,29 @@ class HistoryTest < ApplicationSystemTestCase 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)