Skip to content

Commit

Permalink
Fix warnings about tests with no assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Sep 17, 2024
1 parent be2678e commit 60c1ae7
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 32 deletions.
4 changes: 0 additions & 4 deletions test/helpers/application_helper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,4 @@ def test_friendly_date_ago
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
14 changes: 7 additions & 7 deletions test/integration/user_creation_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
44 changes: 23 additions & 21 deletions test/system/history_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 60c1ae7

Please sign in to comment.