<commit_before>require_relative "../../test_helper"

module SmartAnswer::Calculators
  class BenefitCapCalculatorConfigurationTest < ActiveSupport::TestCase
    context BenefitCapCalculatorConfiguration do
      setup do
        @config = BenefitCapCalculatorConfiguration.new
      end

      context "weekly_benefit_cap" do
        should "be £350 for a single person" do
          assert_equal 350, @config.weekly_benefit_cap["single"]
        end
        should "be £500 for a couple with or without children" do
          assert_equal 500, @config.weekly_benefit_cap["couple"]
        end
        should "be £500 for a lone parent" do
          assert_equal 500, @config.weekly_benefit_cap["parent"]
        end
      end

      context "benefit type data" do
        should "have a question and description for each benefit type" do
          assert_equal :jsa_amount?, @config.benefits.fetch("jsa")["question"]
          assert_equal "Jobseeker’s Allowance", @config.benefits.fetch("jsa")["description"]
        end
        should "be able get a hash of just benefits and questions" do
          assert_kind_of Hash, @config.questions
        end
        should "be able get a hash of just benefits and descriptions" do
          assert_kind_of Hash, @config.descriptions
        end
      end

      context "exempt_benefits" do
        should "contain an entry for Disability Living Allowance" do
          assert_includes @config.exempt_benefits, "Disability Living Allowance"
        end
      end
    end
  end
end<commit_msg>Make it clear that the benefits covenience method is being tested<commit_after>require_relative "../../test_helper"

module SmartAnswer::Calculators
  class BenefitCapCalculatorConfigurationTest < ActiveSupport::TestCase
    context BenefitCapCalculatorConfiguration do
      setup do
        @config = BenefitCapCalculatorConfiguration.new
      end

      context "weekly_benefit_cap" do
        should "be £350 for a single person" do
          assert_equal 350, @config.weekly_benefit_cap["single"]
        end
        should "be £500 for a couple with or without children" do
          assert_equal 500, @config.weekly_benefit_cap["couple"]
        end
        should "be £500 for a lone parent" do
          assert_equal 500, @config.weekly_benefit_cap["parent"]
        end
      end

      context "benefits data" do
        should "have a question and description for each benefit" do
          assert_equal :jsa_amount?, @config.benefits.fetch("jsa")["question"]
          assert_equal "Jobseeker’s Allowance", @config.benefits.fetch("jsa")["description"]
        end
        should "be able get a hash of just benefits and questions" do
          assert_kind_of Hash, @config.questions
        end
        should "be able get a hash of just benefits and descriptions" do
          assert_kind_of Hash, @config.descriptions
        end
      end

      context "exempt_benefits" do
        should "contain an entry for Disability Living Allowance" do
          assert_includes @config.exempt_benefits, "Disability Living Allowance"
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.06604680987495992, 'fraction_numerical': 0.011542160949022122, 'mean_word_length': 2.6835891381345927, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2497136', 'n_tokens_mistral': 895, 'n_tokens_neox': 830, 'n_words': 281}