<commit_before>require 'spec_helper'

describe GenerateOwnershipsJob do
  describe '.classes_needing_processing' do
    it 'includes everything we need' do
      expect(GenerateOwnershipsJob.classes_needing_processing).to include(
        Contribution, Expense, Transfer
      )
    end
  end

  describe '.perform' do
    it 'runs' do
      GenerateOwnershipsJob.classes_needing_processing.each do |model|
        FactoryGirl.create model
      end

      GenerateOwnershipsJob.perform
    end
  end
end<commit_msg>Patch fix for ownerships<commit_after>require 'spec_helper'

describe GenerateOwnershipsJob do
  describe '.classes_needing_processing' do
    it 'includes everything we need' do
      expect(GenerateOwnershipsJob.classes_needing_processing).to include(
        Contribution, Expense, Transfer
      )
    end
  end

  describe '.perform' do
    it 'runs' do
      GenerateOwnershipsJob.classes_needing_processing.each do |model|
        FactoryGirl.create model
      end

      allow(PortfolioPresenter).to receive(:all) { double(value_at: 1, cashflow_at: 0) }

      GenerateOwnershipsJob.perform
    end
  end
end
{'fraction_non_alphanumeric': 0.06266548984995587, 'fraction_numerical': 0.00176522506619594, 'mean_word_length': 3.4296875, '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': '4811670', 'n_tokens_mistral': 337, 'n_tokens_neox': 325, 'n_words': 82}