<commit_before># frozen_string_literal: true

require 'rails_helper'

def fill_out_open_course_creator_form
  fill_in 'Program title:', with: '한국어'
  fill_in 'Institution:', with: 'العَرَبِية'
  find('.course_start-datetime-control input').set(Date.new(2017, 1, 4))
  find('.course_end-datetime-control input').set(Date.new(2017, 2, 1))
  page.find('body').click
end

describe 'open course creation', type: :feature, js: true do
  let(:user) { create(:user) }
  let(:campaign) do
    create(:campaign,
           id: 10001,
           title: 'My Awesome Campaign',
           description: 'This is the best campaign',
           default_course_type: 'Editathon',
           passcode: '<PASSWORD>code',
           template_description: 'This is the template description')
  end

  before do
    stub_wiki_validation
    @system_time_zone = Time.zone
    Time.zone = 'Eastern Time (US & Canada)'
    page.current_window.resize_to(1920, 1080)

    allow(Features).to receive(:open_course_creation?).and_return(true)
    allow(Features).to receive(:disable_wiki_output?).and_return(true)<commit_msg>Corrects specs<commit_after># frozen_string_literal: true

require 'rails_helper'

def fill_out_open_course_creator_form
  fill_in 'Program title:', with: '한국어'
  fill_in 'Institution:', with: 'العَرَبِية'
  find('.course_start-datetime-control input').set(Date.new(2017, 1, 4))
  find('.course_end-datetime-control input').set(Date.new(2017, 2, 1))
  page.find('body').click
end

describe 'open course creation', type: :feature, js: true do
  let(:user) { create(:user) }
  let(:campaign) do
    create(:campaign,
           id: 10001,
           title: 'My Awesome Campaign',
           description: 'This is the best campaign',
           default_course_type: 'Editathon',
           default_passcode: '<PASSWORD>',
           template_description: 'This is the template description')
  end

  before do
    stub_wiki_validation
    @system_time_zone = Time.zone
    Time.zone = 'Eastern Time (US & Canada)'
    page.current_window.resize_to(1920, 1080)

    allow(Features).to receive(:open_course_creation?).and_return(true)
    allow(Features).to receive(:disable_wiki_output?).and_return(true)
{'fraction_non_alphanumeric': 0.1275626423690205, 'fraction_numerical': 0.022779043280182234, 'mean_word_length': 3.9683257918552037, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6260085', 'n_tokens_mistral': 755, 'n_tokens_neox': 696, 'n_words': 158}