diff --git a/app/services/abf_worker_service/platform_metadata.rb b/app/services/abf_worker_service/platform_metadata.rb index 9fe6efe52..d59757d7f 100644 --- a/app/services/abf_worker_service/platform_metadata.rb +++ b/app/services/abf_worker_service/platform_metadata.rb @@ -8,14 +8,14 @@ module AbfWorkerService end def regenerate! - return unless can_regenerate?(platform) + return unless can_regenerate? Resque.push( 'publish_worker_default', 'class' => 'AbfWorker::PublishWorkerDefault', 'args' => [{ id: Time.now.to_i, - cmd_params: cmd_params(platform), + cmd_params: cmd_params, main_script: 'regenerate_platform_metadata.sh', platform: { platform_path: "#{platform.path}/repository", diff --git a/spec/services/abf_worker_service/platform_metadata_spec.rb b/spec/services/abf_worker_service/platform_metadata_spec.rb new file mode 100644 index 000000000..bd589afc5 --- /dev/null +++ b/spec/services/abf_worker_service/platform_metadata_spec.rb @@ -0,0 +1,22 @@ +require 'spec_helper' + +describe AbfWorkerService::PlatformMetadata do + let(:platform) { FactoryGirl.build(:platform, id: 123) } + + before do + stub_symlink_methods + end + + subject { AbfWorkerService::PlatformMetadata.new(platform) } + + context '#regenerate!' do + + it 'creates task' do + expect(platform).to receive(:start_regeneration).and_return(true) + expect(Resque).to receive(:push) + subject.regenerate! + end + + end + +end