<commit_before>require File.dirname(__FILE__) + '/../test_helper'

class RoutesTest < ActionController::IntegrationTest

  # I'm just going to test some of the oddballs here...

  should "route to news" do
    assert_routing '/news', :controller => 'news', :action => 'index'
    assert_routing '/news/1', :controller => 'news', :action => 'show', :id => '1'
    assert_equal '/news/1', news_item_path(1)
    assert_equal '/news', news_path
    assert_equal '/news', news_items_path
  end

  should "route to bible" do
    assert_recognizes({:controller => 'bibles', :action => 'show', :book => 'John', :chapter => '0'}, '/bible/John')
  end

  should "route to pages" do
    assert_recognizes({:controller => 'pages', :action => 'show_for_public', :path => 'home'}, '/pages/home')
  end

  should "route to admin dashboard" do
    assert_routing '/admin', :controller => 'administration/dashboards', :action => 'show'
  end

  should "route in the admin namespace" do
    assert_routing '/admin/admins', :controller => 'administration/admins', :action => 'index'
  end

  should "route to admin/files" do
    assert_routing '/admin/files', :controller => 'administration/files', :action => 'index'
    assert_routing '/admin/files/abc123_.abc123_', :controller => 'administration/files', :action => 'show', :id => 'abc123_.abc123_'
    post '/session', :email => people(:tim).email, :password => '<PASSWORD>'
    assert_redirected_to stream_path
    get '/admin/files/thisis..evil' # route not recognized
    assert_response :missing
  end

end<commit_msg>Fix test broken by exception.<commit_after>require File.dirname(__FILE__) + '/../test_helper'

class RoutesTest < ActionController::IntegrationTest

  # I'm just going to test some of the oddballs here...

  should "route to news" do
    assert_routing '/news', :controller => 'news', :action => 'index'
    assert_routing '/news/1', :controller => 'news', :action => 'show', :id => '1'
    assert_equal '/news/1', news_item_path(1)
    assert_equal '/news', news_path
    assert_equal '/news', news_items_path
  end

  should "route to bible" do
    assert_recognizes({:controller => 'bibles', :action => 'show', :book => 'John', :chapter => '0'}, '/bible/John')
  end

  should "route to pages" do
    assert_recognizes({:controller => 'pages', :action => 'show_for_public', :path => 'home'}, '/pages/home')
  end

  should "route to admin dashboard" do
    assert_routing '/admin', :controller => 'administration/dashboards', :action => 'show'
  end

  should "route in the admin namespace" do
    assert_routing '/admin/admins', :controller => 'administration/admins', :action => 'index'
  end

  should "route to admin/files" do
    assert_routing '/admin/files', :controller => 'administration/files', :action => 'index'
    assert_routing '/admin/files/abc123_.abc123_', :controller => 'administration/files', :action => 'show', :id => 'abc123_.abc123_'
    post '/session', :email => people(:tim).email, :password => '<PASSWORD>'
    assert_redirected_to stream_path
    assert_raise(ActionController::RoutingError) do
      get '/admin/files/thisis..evil' # route not recognized
    end
  end

end
{'fraction_non_alphanumeric': 0.15807777426493835, 'fraction_numerical': 0.010749288650015808, 'mean_word_length': 4.195402298850575, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6792449', 'n_tokens_mistral': 998, 'n_tokens_neox': 958, 'n_words': 276}