-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
130 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Check filesystem based on catalog, updating database | ||
# @see Audit::CatalogToMoab | ||
class CatalogToMoabJob < ApplicationJob | ||
queue_as :c2m | ||
|
||
before_enqueue do |job| | ||
raise ArgumentError, 'CompleteMoab param required' unless job.arguments.first.is_a?(CompleteMoab) | ||
end | ||
|
||
# @param [CompleteMoab] complete_moab object to checksum | ||
# @param [String] storage_dir | ||
# @see Audit::CatalogToMoab#initialize | ||
def perform(complete_moab, storage_dir) | ||
Audit::CatalogToMoab.new(complete_moab, storage_dir).check_catalog_version | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
require 'rails_helper' | ||
|
||
describe CatalogToMoabJob, type: :job do | ||
let(:job) { described_class.new(cm) } | ||
let(:cm) { create :complete_moab } | ||
let(:storage_dir) { 'foobar' } | ||
|
||
describe '#perform' do | ||
let(:validator) { instance_double(Audit::CatalogToMoab) } | ||
|
||
it 'calls Audit::CatalogToMoab#check_catalog_version' do | ||
expect(validator).to receive(:check_catalog_version) | ||
expect(Audit::CatalogToMoab).to receive(:new).with(cm, storage_dir).and_return(validator) | ||
job.perform(cm, storage_dir) | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.