<commit_before>require 'spec_helper'

describe Clearbit::Discovery do
  before do |example|
    Clearbit.key = 'clearbit_key'
  end

  context 'Discovery API' do
    it 'should call out to the Discovery API' do
      body  = []
      query = {query: [{name: 'stripe'}]}

      stub_request(:post, "https://discovery.clearbit.com/v1/companies/search").
        with(:headers => {'Authorization'=>'Bearer clearbit_key'}, body: query.to_json).
        to_return(:status => 200, :body => body.to_json, headers: {'Content-Type' => 'application/json'})

      Clearbit::Discovery.search(name: 'stripe')
    end
  end
end<commit_msg>improve test<commit_after>require 'spec_helper'

describe Clearbit::Discovery do
  before do |example|
    Clearbit.key = 'clearbit_key'
  end

  it 'should call out to the Discovery API' do
    body  = []
    query = {query: [{name: 'stripe'}]}

    stub_request(:post, "https://discovery.clearbit.com/v1/companies/search").
      with(:headers => {'Authorization'=>'Bearer clearbit_key'}, body: query.to_json).
      to_return(:status => 200, :body => body.to_json, headers: {'Content-Type' => 'application/json'})

    Clearbit::Discovery.search(name: 'stripe')
  end
end
{'fraction_non_alphanumeric': 0.15333333333333332, 'fraction_numerical': 0.006666666666666667, 'mean_word_length': 3.8623481781376516, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 2, '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': '7468832', 'n_tokens_mistral': 406, 'n_tokens_neox': 389, 'n_words': 91}