Sha256: 20cd8d8df058ee06dfa96e8f1d8e2432e520c359f32dafc6357a7705336ec0e0

Contents?: true

Size: 1.27 KB

Versions: 25

Compression:

Stored size: 1.27 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
      FactoryGirl.create :digital_asset, sami_code: 'meh', orderable: true    

      DigitalAsset.count.should be 1
      DigitalAsset.first.orderable.should be true
    end        
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
daengine-0.7.3 spec/lib/content_service_processor_spec.rb
daengine-0.7.2 spec/lib/content_service_processor_spec.rb
daengine-0.7.1 spec/lib/content_service_processor_spec.rb
daengine-0.7 spec/lib/content_service_processor_spec.rb
daengine-0.6.23 spec/lib/content_service_processor_spec.rb
daengine-0.6.22 spec/lib/content_service_processor_spec.rb
daengine-0.6.21 spec/lib/content_service_processor_spec.rb
daengine-0.6.20 spec/lib/content_service_processor_spec.rb
daengine-0.6.19 spec/lib/content_service_processor_spec.rb
daengine-0.6.18 spec/lib/content_service_processor_spec.rb
daengine-0.6.17 spec/lib/content_service_processor_spec.rb
daengine-0.6.16 spec/lib/content_service_processor_spec.rb
daengine-0.6.15 spec/lib/content_service_processor_spec.rb
daengine-0.6.14 spec/lib/content_service_processor_spec.rb
daengine-0.6.13 spec/lib/content_service_processor_spec.rb
daengine-0.6.11 spec/lib/content_service_processor_spec.rb
daengine-0.6.10 spec/lib/content_service_processor_spec.rb
daengine-0.6.9 spec/lib/content_service_processor_spec.rb
daengine-0.6.8 spec/lib/content_service_processor_spec.rb
daengine-0.6.5 spec/lib/content_service_processor_spec.rb