<commit_before>require 'test_helper'

class AllLayoutTest < ActionView::TestCase
  include PrivateAllLayoutTest
  helper PicturesHelper

  test "should include this file" do
#    flunk
  end

#-------------
# Html tests:

  test "should be one html tag" do
    assert_select 'html', 1
  end

  test "html tag should include one head tag" do
    assert_select 'html head', 1
  end

  test "head tag should include one style tag" do
    assert_select 'head style', 1
    assert_select 'head style.styles', 1
  end

  test "html tag should include one body tag" do
    assert_select 'html body', 1
  end

#-------------
  private

  def setup(*args)
    setup_with_controller unless args.empty?
    render_layout "#{Rails.root}/app/views/layouts/application", *args
  end

end
<commit_msg>Add script test.<commit_after>require 'test_helper'

class AllLayoutTest < ActionView::TestCase
  include PrivateAllLayoutTest
  helper PicturesHelper

  test "should include this file" do
#    flunk
  end

  test "should have the right document type" do
    assert_equal '<!DOCTYPE html>', (rendered.slice 0...rendered.index("\n"))
  end

#-------------
# Html tests:

  test "should be one html tag" do
    assert_select 'html', 1
  end

  test "html tag should include one head tag" do
    assert_select 'html head', 1
  end

  test "head tag should include one title tag" do
    assert_select 'head title', 1
    assert_select 'head > title:first-child', 1
  end

  test "head tag should include six script tags" do
    assert_select 'head script', 6
  end

  test "head tag should include certain script tags" do
    %w[prototype effects dragdrop controls rails application
        ].each_with_index do |e,i|
      assert_select "head title + #{'* + '*i} script[src=?]",
          Regexp.new(%Q@/javascripts/#{e}\\.js\\?\\d*\\z@)
    end
  end

  test "head tag should include one style tag" do
    assert_select 'head style', 1
    assert_select 'head style.styles', 1
    assert_select 'head > style:last-child', 1
  end

  test "html tag should include one body tag" do
    assert_select 'html body', 1
  end

#-------------
  private

  def setup(*args)
    setup_with_controller unless args.empty?
    render_layout "#{Rails.root}/app/views/layouts/application", *args
  end

end

{'fraction_non_alphanumeric': 0.11159929701230228, 'fraction_numerical': 0.006590509666080844, 'mean_word_length': 2.9947368421052634, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '3613117', 'n_tokens_mistral': 722, 'n_tokens_neox': 684, 'n_words': 252}