retry_failed_spec.rb revision 66ae4e01390ec8ddfd3f6fa5361095d5d2f1c2bd
6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehaserequire 'spec_helper'
e4d81151f4841a6354d043551a970418b32be02aEugen Kuksa
6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehasedescribe Repository do
6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehase
6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehase describe 'failed ontology' do
6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehase let(:ontology_version){ create :ontology_version }
87009975356ac69021bebf6a09e6c3b19dd2008bTim Reddehase let(:ontology){ ontology_version.ontology }
6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehase let(:repository){ ontology.repository }
6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehase
6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehase before {
6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehase ontology.versions.first.send :update_state!, :failed
6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehase Worker.jobs.clear
6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehase
6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehase repository.ontologies.retry_failed
6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehase repository.reload
6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehase }
7203ae3d43f64ecaf5f210de17b9f2949270948aEugen Kuksa
b09cf42db481bf6c413844a42ae350952f3dab00Tim Reddehase it { Worker.jobs.size.should == 1 }
b09cf42db481bf6c413844a42ae350952f3dab00Tim Reddehase it { ontology.state.should == 'pending' }
6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehase end
6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehase
6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehaseend