<commit_before>require_relative '../test_helper'

describe "Quote integration" do
  before do
    @quote = Factory :quote
    @section = Factory :section, parent: @quote
  end

  it "should show the quote" do
    visit quotes_path
    page.must_have_content 'acme'
  end

  it "should show sub-sections" do
    visit quote_path(@quote)
    page.must_have_content @section.description
  end
end
<commit_msg>add integration tests for quotes<commit_after>require_relative '../test_helper'

describe "Quote integration" do
  before do
    @quote = FactoryGirl.create :quote
    @section = FactoryGirl.create :section, parent: @quote
  end

  it "should show the quote" do
    visit quotes_path
    page.must_have_content 'acme'
  end

  it "should show sub-sections" do
    visit quote_path(@quote)
    page.must_have_content @section.description
  end

  it "has a workflow for creating toplevel sections" do
    visit quote_path @quote
    within 'h3' do
      click_link 'edit'
    end
    click_link 'New Section'
    fill_in 'Description', with: 'Engineering'
    click_button 'Create Section'
    current_path.must_equal quote_path @quote
    page.must_have_content 'Engineering'
  end

  it "has a workflow for creating items" do
    visit quote_path @quote
    within '.section' do
      click_link 'edit'
    end
    click_link 'New Child Item'
    fill_in 'Description', with: 'application modeling'
    fill_in 'Min hours', with: '4'
    fill_in 'Max hours', with: '8'
    click_button 'Create Item'
    current_path.must_equal quote_path @quote
    page.must_have_content 'application modeling'
  end
end

{'fraction_non_alphanumeric': 0.07749535027898326, 'fraction_numerical': 0.0018598884066955983, 'mean_word_length': 3.4833333333333334, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2000591', 'n_tokens_mistral': 504, 'n_tokens_neox': 489, 'n_words': 162}