<commit_before># encoding: utf-8
require File.dirname(__FILE__) + '/../spec_helper'

# this is a huge badass feature test that verifies everything at once
feature "Create a practice" do

  scenario "Practice doesn't exist yet" do
    ENV['CYBERDOJO_USE_HOST'] = 'true'
    visit "/"
    click_on 'create' #practice
    language('Ruby-Rspec').click
    exercise('Bowling_Game').click
    click_on 'ok'

    click_on 'enter' #practice
    click_on 'ok' #your animal is [cheetah, ...]

    within_window(windows.last) do
      within '#filename-list' do
        page.should have_text 'cyber-dojo.sh'
        page.should have_text 'instructions'
        page.should have_text 'hiker.rb'
        page.should have_text 'hiker_spec.rb'
      end
    end
  end
end

def language(language_to_select)
  find("[data-language=\"#{language_to_select}\"]")
end

def exercise exercise_to_select
  find("[data-exercise=\"#{exercise_to_select}\"]")
end<commit_msg>fixed second rspec deprecation warning<commit_after># encoding: utf-8
require File.dirname(__FILE__) + '/../spec_helper'

feature "Create new practice" do

  scenario "And enter as an animal" do
    ENV['CYBERDOJO_USE_HOST'] = 'true'
    visit "/"
    click_on 'create' #practice
    language('Ruby-Rspec').click
    exercise('Bowling_Game').click
    click_on 'ok'

    click_on 'enter' #practice
    click_on 'ok' #your animal is [cheetah, ...]

    within_window(windows.last) do
      within '#filename-list' do
        expect(page).to have_text 'cyber-dojo.sh'
        expect(page).to have_text 'instructions'
        expect(page).to have_text 'hiker.rb'
        expect(page).to have_text 'hiker_spec.rb'
      end
    end
  end
end

def language(language_to_select)
  find("[data-language=\"#{language_to_select}\"]")
end

def exercise exercise_to_select
  find("[data-exercise=\"#{exercise_to_select}\"]")
end
{'fraction_non_alphanumeric': 0.1266774020397209, 'fraction_numerical': 0.0010735373054213634, 'mean_word_length': 3.535279805352798, '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': '7475007', 'n_tokens_mistral': 633, 'n_tokens_neox': 613, 'n_words': 148}