<commit_before>require 'spec_helper'

feature 'Standard Flow' do
  let(:haskell) { create(:haskell) }
  let!(:exercises) {
    create(:exercise, title: 'Succ',        guide: guide, position: 1, description: 'Description of foo')
  }
  let!(:category) { create(:category, name: 'Functional Programming') }
  let!(:path) { create(:path, category: category, language: haskell) }
  let!(:guide) { create(:guide, name: 'getting-started', description: 'An awesome guide',
                        language: haskell, position: 1, path: path) }

  scenario 'do a guide for first time, starting from home' do
    visit '/'

    within('.jumbotron') do
      click_on 'Start Practicing!'
    end

    within('.category-panel') do
      click_on 'haskell'
    end

    click_on 'Start Practicing!'

    expect(page).to have_text('Succ')
  end


end
<commit_msg>Adding test for multi-path categories<commit_after>require 'spec_helper'

feature 'Standard Flow' do
  let(:haskell) { create(:haskell) }
  let!(:exercises) {
    create(:exercise, title: 'Succ', guide: guide, position: 1, description: 'Description of foo')
  }
  let!(:category) { create(:category, name: 'Functional Programming') }
  let!(:path) { create(:path, category: category, language: haskell) }
  let!(:guide) { create(:guide, name: 'getting-started', description: 'An awesome guide',
                        language: haskell, position: 1, path: path) }


  before do
    visit '/'
  end

  context 'single path' do
    scenario 'do a guide for first time, starting from home' do
      within('.jumbotron') do
        click_on 'Start Practicing!'
      end

      within('.category-panel') do
        click_on 'Start Practicing!'
      end

      click_on 'Start Practicing!'
      expect(page).to have_text('Succ')
    end
  end

  context 'multiple paths' do
    let(:js) { create(:language, name: 'js') }
    let!(:path_js) { create(:path, category: category, language: js) }
    let!(:guide_js) { create(:guide, name: 'getting-started-js', description: 'An awesome JS guide',
                             language: js, position: 1, path: path_js) }

    scenario 'do a guide for first time, starting from home' do
      within('.jumbotron') do
        click_on 'Start Practicing!'
      end

      within('.category-panel') do
        click_on 'haskell'
      end

      click_on 'Start Practicing!'
      expect(page).to have_text('Succ')
    end
  end


end

{'fraction_non_alphanumeric': 0.13242574257425743, 'fraction_numerical': 0.0020627062706270625, 'mean_word_length': 3.0619765494137354, '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': '5306868', 'n_tokens_mistral': 776, 'n_tokens_neox': 732, 'n_words': 221}