<commit_before>require 'helper'

describe SBA::Client do
  before do
    @client = SBA::Client.new
  end  
  
  describe "#by_category" do
    before do
      stub_get("license_permit/by_category/doing%20business%20as.json").
        to_return(:status => 200, :body => fixture("doing_business_as.json"))
    end
    
    it "should fetch licenses and permits by category" do
      category = @client.by_category("doing business as")
      category.first.title.should == "Register a Business Name"
    end
  end
end<commit_msg>Added spec for search by state<commit_after>require 'helper'

describe SBA::Client do
  before do
    @client = SBA::Client.new
  end  
  
  describe "#by_category" do
    before do
      stub_get("license_permit/by_category/doing%20business%20as.json").
        to_return(:status => 200, :body => fixture("doing_business_as.json"))
    end
    
    it "should fetch licenses and permits by category" do
      category = @client.by_category("doing business as")
      category.first.title.should == "Register a Business Name"
    end
  end
  
  describe "#by_state" do
    before do
      stub_get("license_permit/all_by_state/ca.json").
        to_return(:status => 200, :body => fixture("business_licenses_permits_api_state.json"))
    end
    
    it "should return business types required to operate in an specific state" do
      by_state = @client.by_state("CA")
      by_state.first.title.should == "Obtain Disability Insurance"
    end
  end
end
{'fraction_non_alphanumeric': 0.10209601081812035, 'fraction_numerical': 0.011494252873563218, 'mean_word_length': 3.2651296829971184, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '942532', 'n_tokens_mistral': 473, 'n_tokens_neox': 453, 'n_words': 120}