<commit_before>require "rails_helper"

describe ProviderProfile::AskToValidateService,
         type: :model do
  subject {
    described_class.new(provider_profile, :ask_to_validate)
  }

  describe "valid" do
    let(:provider_profile) {
      create :provider_profile, :with_office
    }
    it { is_expected.to be_valid }

    describe "persist office address" do
      before { expect(subject.perform).to be_truthy }
      it {
        expect(
          ShippingRequest.last.address_attributes["ciudad"]
        ).to eq(provider_profile.offices.first.ciudad)
      }
    end
  end

  describe "invalid without office address" do
    let(:provider_profile) { create :provider_profile }
    before { expect(provider_profile.offices.count).to eq(0) }
    it {
      is_expected.to_not be_valid<commit_msg>rename class reference<commit_after>require "rails_helper"

describe ProviderProfile::TransitionTo::AskToValidateService,
         type: :model do
  subject {
    described_class.new(provider_profile, :ask_to_validate)
  }

  describe "valid" do
    let(:provider_profile) {
      create :provider_profile, :with_office
    }
    it { is_expected.to be_valid }

    describe "persist office address" do
      before { expect(subject.perform).to be_truthy }
      it {
        expect(
          ShippingRequest.last.address_attributes["ciudad"]
        ).to eq(provider_profile.offices.first.ciudad)
      }
    end
  end

  describe "invalid without office address" do
    let(:provider_profile) { create :provider_profile }
    before { expect(provider_profile.offices.count).to eq(0) }
    it {
      is_expected.to_not be_valid
{'fraction_non_alphanumeric': 0.09040928527794746, 'fraction_numerical': 0.0012217470983506415, 'mean_word_length': 3.210796915167095, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3521455', 'n_tokens_mistral': 504, 'n_tokens_neox': 490, 'n_words': 101}