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