diff --git a/app/jobs/delete_topic_resource_key_job.rb b/app/jobs/delete_topic_resource_key_job.rb index 8f614109f..7d898eace 100644 --- a/app/jobs/delete_topic_resource_key_job.rb +++ b/app/jobs/delete_topic_resource_key_job.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require "ostruct" + class DeleteTopicResourceKeyJob < ApplicationJob queue_as :default diff --git a/app/models/proto_record.rb b/app/models/proto_record.rb index a4c2275d9..c7cd9dead 100644 --- a/app/models/proto_record.rb +++ b/app/models/proto_record.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require "etl/etl" +require "ostruct" class ProtoRecord include ETL::Transformable diff --git a/app/services/find_not_expected_bibs.rb b/app/services/find_not_expected_bibs.rb index 1cb62cbf0..9a587cafa 100644 --- a/app/services/find_not_expected_bibs.rb +++ b/app/services/find_not_expected_bibs.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require "ostruct" + class FindNotExpectedBibs include Interactors::Errors include SplitAnalyzable diff --git a/lib/etl/extractors/csv_file_strategy.rb b/lib/etl/extractors/csv_file_strategy.rb index 7bd1397aa..a11c64430 100644 --- a/lib/etl/extractors/csv_file_strategy.rb +++ b/lib/etl/extractors/csv_file_strategy.rb @@ -2,6 +2,7 @@ require "smarter_csv" require "csv" +require "ostruct" module ETL module Extractors diff --git a/spec/jobs/delete_topic_resource_key_job_spec.rb b/spec/jobs/delete_topic_resource_key_job_spec.rb new file mode 100644 index 000000000..01ef4c097 --- /dev/null +++ b/spec/jobs/delete_topic_resource_key_job_spec.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +require "rails_helper" + +RSpec.describe DeleteTopicResourceKeyJob do + subject { described_class.new } + + let(:topic_resource_key) { "arn:aws:sns:test" } + + describe "#perform" do + let(:perform_job) { subject.perform(topic_resource_key) } + let(:expected_mock_resource) { OpenStruct.new(topic_resource_key: topic_resource_key, slug: topic_resource_key) } + + before { allow(SnsTopicManager).to receive(:delete) } + + it "sends a message to the topic manager" do + expect(SnsTopicManager).to receive(:delete).with(resource: expected_mock_resource) + perform_job + end + end +end