1) Daengine::TeamsiteMetadataParser#parse_tuple_file reads xml Failure/Error: expect { count should have been changed by 2, but was changed by -2 # ./spec/lib/teamsite_metadata_parser_spec.rb:11:in `(root)' 2) Daengine::TeamsiteMetadataParser#parse_tuple_file can read a whole bulk dep oy xml file quickly Failure/Error: expect { count should have been changed by 1578, but was changed by -31 # ./spec/lib/teamsite_metadata_parser_spec.rb:24:in `(root)' 3) Daengine::TeamsiteMetadataParser deleting paths deletes paths that are no-l nger in the tuples for a package Failure/Error: DigitalAsset.find('163742d3-fbc2-4c99-8396-6eabe7464b8f').do uments.should have(2).items Mongoid::Errors::DocumentNotFound: Document not found for class DigitalAsset with id(s) 163742d3-fbc2-4c99-8 96-6eabe7464b8f. # ./spec/lib/teamsite_metadata_parser_spec.rb:37:in `(root)' 4) Daengine::TeamsiteMetadataParser remove unpublished documents from mongo re oves package records from mongo that are in unpublished state Failure/Error: DigitalAsset.find('11570991-9887-46df-8c47-d0870e6b5008').do uments.should have(1).item Mongoid::Errors::DocumentNotFound: Document not found for class DigitalAsset with id(s) 11570991-9887-46df-8 47-d0870e6b5008. # ./spec/lib/teamsite_metadata_parser_spec.rb:51:in `(root)' 5) DigitalAsset#finders has a finder by fund_id Failure/Error: @asset = FactoryGirl.create :digital_asset, :fund_ids => ['3 3'], NoMethodError: undefined method `fund_ids=' for # # ./spec/models/digital_asset_spec.rb:60:in `(root)' 6) DigitalAsset#finders has a finder by product_id Failure/Error: @asset = FactoryGirl.create :digital_asset, :fund_ids => ['3 3'], NoMethodError: undefined method `fund_ids=' for # # ./spec/models/digital_asset_spec.rb:60:in `(root)' 7) DigitalAsset#finders has a finder by sami_code Failure/Error: @asset = FactoryGirl.create :digital_asset, :fund_ids => ['3 3'], NoMethodError: undefined method `fund_ids=' for # # ./spec/models/digital_asset_spec.rb:60:in `(root)' 8) DigitalAsset#finders has a finder by the embedded doc path Failure/Error: @asset = FactoryGirl.create :digital_asset, :fund_ids => ['3 3'], NoMethodError: undefined method `fund_ids=' for # # ./spec/models/digital_asset_spec.rb:60:in `(root)' 9) DigitalAsset#finders has a type finder for the documents Failure/Error: @asset = FactoryGirl.create :digital_asset, :fund_ids => ['3 3'], NoMethodError: undefined method `fund_ids=' for # # ./spec/models/digital_asset_spec.rb:60:in `(root)' 10) DigitalAsset#finders can chain finders together Failure/Error: @asset = FactoryGirl.create :digital_asset, :fund_ids => ['3 3'], NoMethodError: undefined method `fund_ids=' for # # ./spec/models/digital_asset_spec.rb:60:in `(root)' 11) DigitalAsset#finders has a finder for stale documents Failure/Error: @asset = FactoryGirl.create :digital_asset, :fund_ids => ['3 3'], NoMethodError: undefined method `fund_ids=' for # # ./spec/models/digital_asset_spec.rb:60:in `(root)' 12) DigitalAsset#finders has a method that tells you if the bulk-file processi g is working Failure/Error: @asset = FactoryGirl.create :digital_asset, :fund_ids => ['3 3'], NoMethodError: undefined method `fund_ids=' for # # ./spec/models/digital_asset_spec.rb:60:in `(root)' 13) DigitalAssetLookupService#document-query supports query by product_id Failure/Error: DigitalAsset.where(query).should have(2).digital_asset expected 2 digital_asset, got 53 # ./spec/service/digital_asset_lookup_service_spec.rb:29:in `(root)' 14) DigitalAssetLookupService#document-query supports query by content_type_id Failure/Error: DigitalAsset.where(query).should have(1).digital_asset expected 1 digital_asset, got 2 # ./spec/service/digital_asset_lookup_service_spec.rb:42:in `(root)' 15) DigitalAssetLookupService#document-query supports query by product_id and ontent_type_id Failure/Error: DigitalAsset.where(query).should have(1).digital_asset expected 1 digital_asset, got 3 # ./spec/service/digital_asset_lookup_service_spec.rb:49:in `(root)' 16) DigitalAssetLookupService#document-query supports query by product_id and ontent_type_id and audiences Failure/Error: DigitalAsset.where(query).should have(1).digital_asset expected 1 digital_asset, got 4 # ./spec/service/digital_asset_lookup_service_spec.rb:56:in `(root)' 17) DigitalAssetLookupService#document-query supports service query by product type_id Failure/Error: DigitalAssetLookupService.find_documents_by_query(['420']).s ould have(2).digital_asset expected 2 digital_asset, got 60 # ./spec/service/digital_asset_lookup_service_spec.rb:59:in `(root)' 18) DigitalAssetLookupService#document-query supports service query by content type_id Failure/Error: DigitalAssetLookupService.find_documents_by_query(nil, ['909 ]).should have(1).digital_asset expected 1 digital_asset, got 6 # ./spec/service/digital_asset_lookup_service_spec.rb:68:in `(root)' 19) DigitalAssetLookupService#document-query supports service query by product type_id and content_type_id Failure/Error: DigitalAssetLookupService.find_documents_by_query(['303','42 '], '909').should have(1).digital_asset expected 1 digital_asset, got 7 # ./spec/service/digital_asset_lookup_service_spec.rb:72:in `(root)' 20) DigitalAssetLookupService#document-query supports service query by product type_id, content_type_id and audience_ids Failure/Error: DigitalAssetLookupService.find_documents_by_query(['303','42 '], '909', ['690']).should have(1).digital_asset expected 1 digital_asset, got 8 # ./spec/service/digital_asset_lookup_service_spec.rb:75:in `(root)' 21) DigitalAssetLookupService#document-query supports service query by product type_id and finra Failure/Error: DigitalAssetLookupService.find_documents_by_query('420',nil, il,true).should have(1).digital_asset expected 1 digital_asset, got 9 # ./spec/service/digital_asset_lookup_service_spec.rb:78:in `(root)' SSC_Developer_Installation_Guide-163742d3-fbc2-4c99-8396-6eabe7464b8f.doc on disk! Removing from metadata C:\dev\projects\daengine>rspec spec\lib\teamsite_metadata_parser_spec.rb JRuby limited openssl loaded. http://jruby.org/openssl gem install jruby-openssl for full support. [2012-09-04 15:08:55] TeamsiteMetadataParser: Unable to locate file C:/dev/proje cts/daengine/spec/mock_data/digitalAssets/SSC_Developer_Installation_Guide-16374 2d3-fbc2-4c99-8396-6eabe7464b8f.doc on disk! Removing from metadata [2012-09-04 15:08:55] TeamsiteMetadataParser: Unable to locate file C:/dev/proje cts/daengine/spec/mock_data/digitalAssets/FormsLit_2012_05_01_DesignSpecs-163742d3-fbc2-4c99-8396-6eabe7464b8f.pdf on disk! Removing from metadata [2012-09-04 15:08:55] TeamsiteMetadataParser: Unable to locate file C:/dev/proje cts/daengine/spec/mock_data/digitalAssets/FormsLit_2012_05_01_DesignSpecs-821c7077-b39a-4efb-9ef4-350220e09d07.pdf on disk! Removing from metadata [2012-09-04 15:08:55] TeamsiteMetadataParser: 0 records added, 0 updated, 2 remo require 'spec_helper' describe Daengine::DigitalAssetProcessor do before { Daengine.configure(:assets_path => Dir.pwd+'/spec/mock_data', :daengine_yml_file => Dir.pwd+'/spec/mock_data/daengine.yml', :digital_assets_file_directory => Dir.pwd + '/spec/mock_data' ) } context "process_tuple_directory" do it 'check orderable flag' do # process bulk deploy file in the mock dir p " !! da count #{DigitalAsset.count}" FileUtils.touch Dir.glob(Dir.pwd+'/spec/mock_data/bulk-ssc_deploy.xml') #DigitalAsset.count.should == 0 File.stub(:exist?) { true } File.stub(:mtime) { Time.now } Daengine::DigitalAssetProcessor.process_tuple_directory result = DigitalAsset.all result.each{ |da| da.update_attribute(:orderable,true)} Daengine::DigitalAssetProcessor.process_tuple_directory DigitalAsset.first.orderable.should be true end end end require 'spec_helper' describe Daengine::TeamsiteMetadataParser do before { Daengine.configure(:assets_path => Dir.pwd+'/spec/mock_data', :daengine_yml_file => Dir.pwd+'/spec/mock_data/daengine.yml', :digital_assets_file_directory => Dir.pwd + '/spec/mock_data/' ) } #subject { Daengine::TeamsiteMetadataParser } context "#parse_tuple_file" do it 'reads xml' do # subject.logger= Logger.new(STDOUT) p " !! da count #{DigitalAsset.count}" DigitalAsset.delete_all file = File.expand_path('./spec/mock_data/selective_new_package.xml') expect { subject.parse_tuple_file(open(file),'2011-09-04 11:59:47 -0600') }.to change(DigitalAsset, :count).by(2) entered = DigitalAsset.first entered.id.should == '163742d3-fbc2-4c99-8396-6eabe7464b8f' entered.documents[0].path.should == '/digitalAssets/SSC_Developer_Installation_Guide-163742d3-fbc2-4c99-8396-6eabe7464b8f.doc' entered.summary.should == 'first foo bar...' DigitalAsset.first.documents.count.should eq(2) end end end require 'spec_helper' describe Daengine::TeamsiteMetadataParser do before { Daengine.configure(:assets_path => Dir.pwd+'/spec/mock_data', :daengine_yml_file => Dir.pwd+'/spec/mock_data/daengine.yml', :digital_assets_file_directory => Dir.pwd + '/spec/mock_data/' ) } subject { Daengine::TeamsiteMetadataParser } context "#parse_tuple_file" do it 'reads xml' do # subject.logger= Logger.new(STDOUT) file = File.expand_path('./spec/mock_data/selective_new_package.xml') expect { subject.parse_tuple_file(open(file),'2011-09-04 11:59:47 -0600') }.to change(DigitalAsset, :count).by(2) entered = DigitalAsset.first entered.id.should == '163742d3-fbc2-4c99-8396-6eabe7464b8f' entered.documents[0].path.should == '/digitalAssets/SSC_Developer_Installation_Guide-163742d3-fbc2-4c99-8396-6eabe7464b8f.doc' entered.summary.should == 'first foo bar...' DigitalAsset.first.documents.count.should eq(2) end it 'can read a whole bulk deploy xml file quickly' do # subject.logger= Logger.new(STDOUT) file = File.expand_path('./spec/mock_data/bulk-ssc_deploy.xml') open_file = open(file, 'rb') expect { subject.parse_tuple_file(open_file,'2011-09-04 11:59:47 -0600') }.to change(DigitalAsset.count).by(34) end end context 'deleting paths' do before do file = File.expand_path('./spec/mock_data/selective_new_package.xml') subject.parse_tuple_file(open(file),'2011-09-04 11:59:47 -0600') end it 'deletes paths that are no-longer in the tuples for a package' do file = File.expand_path('./spec/mock_data/selective_path_delete_from_package.xml') DigitalAsset.find('163742d3-fbc2-4c99-8396-6eabe7464b8f').documents.should have(2).items expect { subject.parse_tuple_file(open(file),'2011-09-04 11:59:47 -0600') }.to change(DigitalAsset, :count).by(0) DigitalAsset.find('163742d3-fbc2-4c99-8396-6eabe7464b8f').documents.should have(1).item end end context 'remove unpublished documents from mongo' do before do file = File.expand_path('./spec/mock_data/selective-ssc_2012_05_18_13_48_03_publish.xml') subject.parse_tuple_file(open(file),'2011-09-04 11:59:47 -0600') end it 'removes package records from mongo that are in unpublished state' do DigitalAsset.find('11570991-9887-46df-8c47-d0870e6b5008').documents.should have(1).item file = File.expand_path('./spec/mock_data/selective-ssc_2012_05_18_13_56_18_unpublish.xml') expect { subject.parse_tuple_file(open(file),'2011-09-04 11:59:47 -0600') }.to change(DigitalAsset, :count).by(-1) end end end ects/daengine/spec/mock_data/digitalAssets/Apache_Tomcat7-User_Guide-11570991-9887-46df-8c47-d0870e6b5008.pdf on disk! Removing from metadata