Sha256: 373534ec8284ce29946b17c2692cbb4ac97dee9abbc783807b76b7c9cd38f567

Contents?: true

Size: 1.11 KB

Versions: 101

Compression:

Stored size: 1.11 KB

Contents

require 'spec_helper'

describe Daengine::TaxonomyProcessor do
  before { Daengine.configure(:taxonomy_xml_filepath => Dir.pwd+'/spec/mock_data/taxonomy/taxonomy.xml',
                              :taxonomyengine_yml_file => Dir.pwd+'/spec/mock_data/taxonomy/taxonomyengine.yml'
  ) }
  context "process_taxonomy_file" do
    it 'processes only files modified in the last 2 days' do
      # process bulk deploy file in the mock dir
        TaxonomyTerm.destroy_all
        before = TaxonomyTerm.count
        FileUtils.touch Dir.pwd+'/spec/mock_data/taxonomy/taxonomy.xml'
        before = TaxonomyTerm.count
        Daengine::TaxonomyProcessor.process_taxonomy_file
        after = TaxonomyTerm.count
        (after - before).should == 1057
    end
    it 'processes only those files that modified since the last time the daengine taxonomy process ran' do
      # process any files that has modified since last run. None !!
        before = TaxonomyTerm.count
        Daengine::TaxonomyProcessor.process_taxonomy_file
        after = TaxonomyTerm.count
        (after - before).should == 0
    end
  end
end

Version data entries

101 entries across 101 versions & 1 rubygems

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