Sha256: 7c9c3cf734b93d4c4e52fbc8adcfa1bbf140b5be218d63f19ce9dc48f9726a65

Contents?: true

Size: 1.62 KB

Versions: 46

Compression:

Stored size: 1.62 KB

Contents

require 'spec_helper'

describe Daengine::ContentServiceProcessor do
  context "process_orderable" do
    before do
      FactoryGirl.create :digital_asset, sami_code: 'AA123'    
      FactoryGirl.create :digital_asset, sami_code: 'AA456'    
      ContentServiceResource.stub(:find_all).and_return(
        [OpenStruct.new(:samiCode => 'AA123', :orderable => 'true')])
      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/')      
    end    
    it 'processes orderable digital assets' do  
      DigitalAsset.all.count.should == 2
      DigitalAsset.first.sami_code.should == 'AA123' 
      Daengine::ContentServiceProcessor.process_orderable
      DigitalAsset.first.sami_code.should == 'AA123' 
      DigitalAsset.first.orderable.should be
      DigitalAsset.last.orderable.should_not be
    end
    it 'check orderable flag' do
    # process bulk deploy file in the mock dir
      DigitalAsset.delete_all
      file = File.expand_path('./spec/mock_data/bulk-ssc_deploy.xml')
      open_file = open(file, 'rb')
      Daengine::TeamsiteMetadataParser.parse_tuple_file(open_file,'2011-09-04 11:59:47 -0600')
      result = DigitalAsset.all
      result.each{ |da| da.update_attribute(:orderable,true)}
      Daengine::TeamsiteMetadataParser.parse_tuple_file(open_file,'2011-09-04 11:59:47 -0600')
      DigitalAsset.first.orderable.should be true
      DigitalAsset.last.orderable.should be true
    end        
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
daengine-0.5.9 spec/lib/content_service_processor_spec.rb
daengine-0.4.9 spec/lib/content_service_processor_spec.rb
daengine-0.4.8 spec/lib/content_service_processor_spec.rb
daengine-0.4.7.9 spec/lib/content_service_processor_spec.rb
daengine-0.4.7.8 spec/lib/content_service_processor_spec.rb
daengine-0.4.7.7 spec/lib/content_service_processor_spec.rb
daengine-0.4.7.6 spec/lib/content_service_processor_spec.rb
daengine-0.4.7.5 spec/lib/content_service_processor_spec.rb
daengine-0.4.7.3 spec/lib/content_service_processor_spec.rb
daengine-0.4.7.2 spec/lib/content_service_processor_spec.rb
daengine-0.4.7.1 spec/lib/content_service_processor_spec.rb
daengine-0.4.7 spec/lib/content_service_processor_spec.rb
daengine-0.4.6.5 spec/lib/content_service_processor_spec.rb
daengine-0.4.6.4 spec/lib/content_service_processor_spec.rb
daengine-0.4.6.3 spec/lib/content_service_processor_spec.rb
daengine-0.4.6.2 spec/lib/content_service_processor_spec.rb
daengine-0.4.6 spec/lib/content_service_processor_spec.rb
daengine-0.4.5 spec/lib/content_service_processor_spec.rb
daengine-0.4.0.4 spec/lib/content_service_processor_spec.rb
daengine-0.4.0.3 spec/lib/content_service_processor_spec.rb