<commit_before>require_relative 'app_controller_test_base'

class SetupCustomStartPointControllerTest < AppControllerTestBase

  test 'EB77D9',
  'show shows all custom exercises' do
    # Assumes the exercises volume is default refactoring exercises
    assert_equal [
      'C++ Countdown, Practice Round',
      'C++ Countdown, Round 1',
      'C++ Countdown, Round 2',
      'C++ Countdown, Round 3',
      'C++ Countdown, Round 4',
      'C++ Countdown, Round 5',
      'C++ Countdown, Round 6',
      "Java Countdown, Practice Round",
      "Java Countdown, Round 1",
      "Java Countdown, Round 2",
      "Java Countdown, Round 3",
      "Java Countdown, Round 4",
      'Tennis refactoring, C# NUnit',
      'Tennis refactoring, C++ (g++) assert',
      'Tennis refactoring, Java JUnit',
      'Tennis refactoring, Python unitttest',
      'Tennis refactoring, Ruby Test::Unit',
      'Yahtzee refactoring, C# NUnit',
      'Yahtzee refactoring, C++ (g++) assert',
      'Yahtzee refactoring, Java JUnit',
      'Yahtzee refactoring, Python unitttest'
      ],
      custom_display_names

    do_get 'show'

    assert /data-major\=\"Tennis refactoring/.match(html)
    assert /data-major\=\"Yahtzee refactoring/.match(html)

    assert /data-minor\=\"C# NUnit/.match(html), html

    params = {
      'major' => 'Tennis refactoring',
      'minor' => 'C# NUnit'
    }
    do_get 'save', params
  end

  # - - - - - - - - - - - - - - - - - - - - - -

  private

  def do_get(route, params = {})
    controller = 'setup_custom_start_point'
    get "#{controller}/#{route}", params
    assert_response :success<commit_msg>fix custom-start-point test which now has start-point for git<commit_after>require_relative 'app_controller_test_base'

class SetupCustomStartPointControllerTest < AppControllerTestBase

  test 'EB77D9',
  'show shows all custom exercises' do
    # Assumes the exercises volume is default refactoring exercises
    assert_equal [
      'C++ Countdown, Practice Round',
      'C++ Countdown, Round 1',
      'C++ Countdown, Round 2',
      'C++ Countdown, Round 3',
      'C++ Countdown, Round 4',
      'C++ Countdown, Round 5',
      'C++ Countdown, Round 6',
      "Java Countdown, Practice Round",
      "Java Countdown, Round 1",
      "Java Countdown, Round 2",
      "Java Countdown, Round 3",
      "Java Countdown, Round 4",
      'Tennis refactoring, C# NUnit',
      'Tennis refactoring, C++ (g++) assert',
      'Tennis refactoring, Java JUnit',
      'Tennis refactoring, Python unitttest',
      'Tennis refactoring, Ruby Test::Unit',
      'Yahtzee refactoring, C# NUnit',
      'Yahtzee refactoring, C++ (g++) assert',
      'Yahtzee refactoring, Java JUnit',
      'Yahtzee refactoring, Python unitttest',
      'git, bash'
      ],
      custom_display_names

    do_get 'show'

    assert /data-major\=\"Tennis refactoring/.match(html)
    assert /data-major\=\"Yahtzee refactoring/.match(html)

    assert /data-minor\=\"C# NUnit/.match(html), html

    params = {
      'major' => 'Tennis refactoring',
      'minor' => 'C# NUnit'
    }
    do_get 'save', params
  end

  # - - - - - - - - - - - - - - - - - - - - - -

  private

  def do_get(route, params = {})
    controller = 'setup_custom_start_point'
    get "#{controller}/#{route}", params
    assert_response :success
{'fraction_non_alphanumeric': 0.1374436090225564, 'fraction_numerical': 0.007819548872180452, 'mean_word_length': 2.720357941834452, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7146149', 'n_tokens_mistral': 1133, 'n_tokens_neox': 1085, 'n_words': 295}