-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add job to republish public feed when adding Apple feed
- Loading branch information
Showing
3 changed files
with
37 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
require "builder" | ||
|
||
class PublishPublicFeedJob < ApplicationJob | ||
queue_as :feeder_publishing | ||
|
||
include PodcastsHelper | ||
|
||
attr_writer :publish_feed_job | ||
|
||
def perform(podcast) | ||
publish_feed_job.save_file(podcast, podcast.public_feed) | ||
end | ||
|
||
def publish_feed_job | ||
@publish_feed_job ||= PublishFeedJob.new | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
require "test_helper" | ||
|
||
describe PublishPublicFeedJob do | ||
let(:podcast) { create(:podcast) } | ||
|
||
let(:job) { PublishPublicFeedJob.new } | ||
|
||
describe "saving the public rss file" do | ||
let(:stub_client) { Aws::S3::Client.new(stub_responses: true) } | ||
|
||
it "can call save_file on PublishFeedJob" do | ||
job.publish_feed_job.stub(:s3_client, stub_client) do | ||
refute_nil job.perform(podcast) | ||
end | ||
end | ||
end | ||
end |