<commit_before>require_relative "../../test_helper"
require_relative "flow_test_helper"
require 'gds_api/test_helpers/worldwide'

require "smart_answer_flows/help-if-you-are-arrested-abroad"

class HelpIfYouAreArrestedAbroad < ActiveSupport::TestCase
  include FlowTestHelper
  include GdsApi::TestHelpers::Worldwide

  setup do
    @location_slugs = %w(aruba belgium greece iran syria)
    worldwide_api_has_locations(@location_slugs)
    setup_for_testing_flow SmartAnswer::HelpIfYouAreArrestedAbroadFlow
  end

  should "ask which country the arrest is in" do
    assert_current_node :which_country?
  end

  context "In a country with a prisoner pack" do

    context "Answering with a country without any specific downloads / information" do

      context "Answering Aruba" do
        setup do
          worldwide_api_has_organisations_for_location('aruba', read_fixture_file('worldwide/aruba_organisations.json'))
          add_response :aruba
        end

        should "take the user to the generic answer" do<commit_msg>Fix name of help-if-you-are-arrested-abroad integration test.<commit_after>require_relative "../../test_helper"
require_relative "flow_test_helper"
require 'gds_api/test_helpers/worldwide'

require "smart_answer_flows/help-if-you-are-arrested-abroad"

class HelpIfYouAreArrestedAbroadTest < ActiveSupport::TestCase
  include FlowTestHelper
  include GdsApi::TestHelpers::Worldwide

  setup do
    @location_slugs = %w(aruba belgium greece iran syria)
    worldwide_api_has_locations(@location_slugs)
    setup_for_testing_flow SmartAnswer::HelpIfYouAreArrestedAbroadFlow
  end

  should "ask which country the arrest is in" do
    assert_current_node :which_country?
  end

  context "In a country with a prisoner pack" do

    context "Answering with a country without any specific downloads / information" do

      context "Answering Aruba" do
        setup do
          worldwide_api_has_organisations_for_location('aruba', read_fixture_file('worldwide/aruba_organisations.json'))
          add_response :aruba
        end

        should "take the user to the generic answer" do
{'fraction_non_alphanumeric': 0.06622516556291391, 'fraction_numerical': 0.0, 'mean_word_length': 4.395408163265306, 'pattern_counts': {'":': 0, '<': 5, '<?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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3142986', 'n_tokens_mistral': 652, 'n_tokens_neox': 634, 'n_words': 162}