Skip to content

Commit

Permalink
a11y: disable 404 finder test, which is too brittle
Browse files Browse the repository at this point in the history
  • Loading branch information
cycomachead committed Jul 5, 2024
1 parent b15455f commit 3cee35a
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions utilities/spec/accessibility_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -158,23 +158,23 @@ def a11y_test_cases(course, url)
.excluding(*excluded_elements)
end

it 'has no broken links', **subset_tags do
passed_test = true
page.all('a').each do |link|
url = link['href']
next unless url

# All google docs seem to report 401's falsely in CI.
next if url.match(/docs\.google\.com/)

response = Net::HTTP.get_response(URI(url))
unless [200, 301, 302, 303].include?(response.code.to_i)
passed_test = false
puts "Broken link: #{url} returned a #{response.code}"
end
end
expect(passed_test).to be true
end
# it 'has no broken links', **subset_tags do
# passed_test = true
# page.all('a').each do |link|
# url = link['href']
# next unless url

# # All google docs seem to report 401's falsely in CI.
# next if url.match(/docs\.google\.com/)

# response = Net::HTTP.get_response(URI(url))
# unless [200, 301, 302, 303].include?(response.code.to_i)
# passed_test = false
# puts "Broken link: #{url} returned a #{response.code}"
# end
# end
# expect(passed_test).to be true
# end
end
end

Expand Down

0 comments on commit 3cee35a

Please sign in to comment.