<commit_before>require "spec_helper"
require_relative "../../app/models/api_model"
require_relative "../../app/models/solicitor"

RSpec.describe Solicitor, ".all" do
  it "creates solicitor objects from the API response" do
    fake_response = [
      {
        "id": 1,
        "name": "<NAME>",
        "type": "solicitor"
      },
      {
        "id": 2,
        "name": "<NAME>",
        "type": "agent"
      }
    ]

    fake_api = double(:data_api, solicitors: fake_response)

    allow(Solicitor).to receive(:data_api).and_return(fake_api)
<commit_msg>Move stub in Solicitor spec<commit_after>require "spec_helper"
require_relative "../../app/models/api_model"
require_relative "../../app/models/solicitor"

RSpec.describe Solicitor, ".all" do
  it "creates solicitor objects from the API response" do
    fake_response = [
      {
        "id": 1,
        "name": "<NAME>",
        "type": "solicitor"
      },
      {
        "id": 2,
        "name": "<NAME>",
        "type": "agent"
      }
    ]

    fake_api = double(:data_api, solicitors: fake_response)

    allow(DefenceRequestServiceRota).to receive(:service).with(:auth_api).and_return(fake_api)

{'fraction_non_alphanumeric': 0.155955441302485, 'fraction_numerical': 0.003427592116538132, 'mean_word_length': 2.6049382716049383, 'pattern_counts': {'":': 12, '<': 7, '<?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': '3076937', 'n_tokens_mistral': 392, 'n_tokens_neox': 381, 'n_words': 80}