Skip to content

Commit

Permalink
Require ostruct in DeleteTopicResourceKeyJob
Browse files Browse the repository at this point in the history
This is a change resulting from the move to Ruby 3.3
  • Loading branch information
moveson committed Dec 17, 2024
1 parent 7423a7a commit 099f3f3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/jobs/delete_topic_resource_key_job.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# frozen_string_literal: true

require "ostruct"

class DeleteTopicResourceKeyJob < ApplicationJob
queue_as :default

Expand Down
21 changes: 21 additions & 0 deletions spec/jobs/delete_topic_resource_key_job_spec.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 099f3f3

Please sign in to comment.