<commit_before># encoding: UTF-8
require_relative 'engine_test_helper'

class ReportAProblemTest < EngineIntegrationTest
  with_and_without_javascript do
    context "smart-answer" do
      setup do
        visit "/bridge-of-death"
      end

      context "start page" do
        should "show report-a-problem" do
          assert page.has_selector?('.report-a-problem-toggle a'), "Report a problem link not visible"
        end

        should "have current url in report-a-problem" do
          assert_match /\/bridge-of-death$/, page.find('#url', visible: false).value
        end
      end

      context "question" do
        setup do
          click_on "Start now"
          fill_in "Name:", :with => "Lancelot"
          click_on "Next step"
        end

        should "not show report-a-problem" do
          refute page.has_selector?('.report-a-problem-toggle a'), "Report a problem link shouldn't be visible"
        end
      end

      context "outcome" do
        setup do
          click_on "Start now"
          fill_in "Name:", :with => "Lancelot"
          click_on "Next step"
          choose "To seek the Holy Grail"
          click_on "Next step"
          choose "Blue"
          click_on "Next step"
        end

        should "show report-a-problem" do
          assert page.has_selector?('.report-a-problem-toggle a'), "Report a problem link not visible"<commit_msg>Removed test for not showing report-a-problem<commit_after># encoding: UTF-8
require_relative 'engine_test_helper'

class ReportAProblemTest < EngineIntegrationTest
  with_and_without_javascript do
    context "smart-answer" do
      setup do
        visit "/bridge-of-death"
      end

      context "start page" do
        should "show report-a-problem" do
          assert page.has_selector?('.report-a-problem-toggle a'), "Report a problem link not visible"
        end

        should "have current url in report-a-problem" do
          assert_match /\/bridge-of-death$/, page.find('#url', visible: false).value
        end
      end

      context "question" do
        setup do
          click_on "Start now"
          fill_in "Name:", :with => "Lancelot"
          click_on "Next step"
        end
      end

      context "outcome" do
        setup do
          click_on "Start now"
          fill_in "Name:", :with => "Lancelot"
          click_on "Next step"
          choose "To seek the Holy Grail"
          click_on "Next step"
          choose "Blue"
          click_on "Next step"
        end

        should "show report-a-problem" do
          assert page.has_selector?('.report-a-problem-toggle a'), "Report a problem link not visible"
{'fraction_non_alphanumeric': 0.09211023027557569, 'fraction_numerical': 0.0007550018875047187, 'mean_word_length': 2.052995391705069, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6432657', 'n_tokens_mistral': 776, 'n_tokens_neox': 742, 'n_words': 240}