1 require 'integration_helper'
4 class SmokeTest < ActionDispatch::IntegrationTest
6 Capybara.current_driver = Capybara.javascript_driver
9 def assert_visit_success(allowed=[200])
10 assert_includes(allowed, status_code,
11 "#{current_url} returned #{status_code}, not one of " +
15 def all_links_in(find_spec, text_regexp=//)
16 all(find_spec + ' a').collect { |tag|
17 if tag[:href].nil? or tag[:href].empty? or (tag.text !~ text_regexp)
21 url.host.nil? ? url.path : nil
26 test "all first-level links succeed" do
27 visit page_with_token('active_trustedclient', '/')
29 click_link 'notifications-menu'
30 urls = [all_links_in('nav'),
31 all_links_in('.navbar', /^Manage /)].flatten
33 while not (url = urls.shift).nil?
34 next if seen_urls.include? url
38 # Uncommenting the line below lets you crawl the entire site for a
40 # urls += all_links_in('body')