Sha256: 58d16c058168c4e6811773553566dbd7d01106dd5433c87a44fff6c1f0fa48a6

Contents?: true

Size: 1.4 KB

Versions: 1

Compression:

Stored size: 1.4 KB

Contents

require 'spec_helper'

describe Daengine::DigitalAssetExtensionProcessor do
  before { Daengine.configure(:digital_asset_extension_filepath => Dir.pwd+'/spec/mock_data/merrill_lynch_extension.json'
  ) }
  context "process_digital_asset_extension_file" do
    before do
      asset1 = FactoryGirl.create :digital_asset, :product_ids => ['303','420'], 
        :audiences => ['690'], :sami_code => 'F000000.BAR'
      doc1 = FactoryGirl.build :document, :content_type => '909',
        :path => '/1/foo/bar/foobar.doc'
      doc2 = FactoryGirl.build :document, :path => '/2/foo/bar/foobar.doc'
        
      asset1.documents << doc1
      asset1.documents << doc2
      asset1.save!

      asset2 = FactoryGirl.create :digital_asset, :product_ids => ['420'], 
        :sami_code => 'MEH12345.000', :guid => 'guid-2'
      doc3 = FactoryGirl.build :document, :content_type => '549',
        :path => '/1/foo/bar/FINRA-foobar.doc'
      asset2.documents << doc3
      asset2.save!
    end
    it 'processes all the digital assets found' do
        Daengine::DigitalAssetExtensionProcessor.process_extension_file
        DigitalAsset.key_account_in('Merrill Lynch').should have(1).digital_asset
        DigitalAsset.key_account_in('Merrill Lynch')[0].ml_category.should eq('broker_dealer')
        DigitalAsset.key_account_in('Merrill Lynch')[0].control_number.should eq('ML 13-005518')
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
daengine-0.5.13 spec/lib/digital_asset_extension_processor_spec.rb