Fix warnings about tests with no assertions

This commit is contained in:
Tom Hughes 2024-09-04 19:07:00 +01:00
parent be2678e0dd
commit 60c1ae79d6
3 changed files with 28 additions and 30 deletions

View 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
def test_body_class; end
def test_header_nav_link_class; end
end

View file

@ -171,13 +171,13 @@ class UserCreationTest < ActionDispatch::IntegrationTest
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"

View file

@ -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
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_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
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)