<commit_before>require 'spec_helper'

describe "sites/require.html.erb" do
  # before(:each) do
  #   assign(:site, stub_model(Site,
  #     :name => "MyString",
  #     :template => "MyText"
  #   ).as_new_record)
  # end

  it "renders require page" do
    @site = mock_model(Site, :name => 'MyString', :template => 'MyText')

    render
    
    rendered.should have_content('MyString requires')
    rendered.should have_content('MyText')
    rendered.should have_content('Site texts:')
    rendered.should have_link('New site text')
    rendered.should have_content('Site files:')
    rendered.should have_link('New site file')
    rendered.should have_link('Close')
  end
end
<commit_msg>change: rewrote require view test with assert_select<commit_after>require 'spec_helper'

describe "sites/require.html.erb" do
  # before(:each) do
  #   assign(:site, stub_model(Site,
  #     :name => "MyString",
  #     :template => "MyText"
  #   ).as_new_record)
  # end

  it "renders require page" do
    @site = mock_model(Site, :name => 'MyString', :template => 'MyText')

    render
    
    assert_select 'h1', 'MyString requires'
    assert_select 'div>p', "Template:\n\tMyText"
    assert_select 'div>h2', 'Site texts:'
    assert_select 'div>a', 'New site text'
    assert_select 'div>h2', 'Site files:'
    assert_select 'div>a', 'New site file'
    assert_select 'a', 'Close'
  end
end

{'fraction_non_alphanumeric': 0.1399856424982053, 'fraction_numerical': 0.0021536252692031586, 'mean_word_length': 3.6936026936026938, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 16, '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': '6707631', 'n_tokens_mistral': 478, 'n_tokens_neox': 468, 'n_words': 113}