Remove delayed job that updated media url for podcast episodes (#5770)

Follow up to #5729
This commit is contained in:
Asha Balasubramaniam 2020-01-27 16:07:00 -05:00 committed by Mac Siri
parent 397ef313de
commit 4568f4b6f0
2 changed files with 0 additions and 38 deletions

View file

@ -1,12 +0,0 @@
module PodcastEpisodes
class UpdateMediaUrlJob < ApplicationJob
queue_as :podcast_episode_update
# @param episode_id [Integer] - episode id
# @param enclosure_url [String] enclosure url from podcast RSS
def perform(episode_id, enclosure_url, service = Podcasts::UpdateEpisodeMediaUrl)
episode = PodcastEpisode.find_by(id: episode_id)
service.call(episode, enclosure_url) if episode
end
end
end

View file

@ -1,26 +0,0 @@
require "rails_helper"
RSpec.describe PodcastEpisodes::UpdateMediaUrlJob, type: :job do
include_examples "#enqueues_job", "podcast_episode_update", 1, "https://example.com/"
describe "#perform_now" do
let(:feed) { double }
let(:episode) { create(:podcast_episode) }
let(:url) { Faker::Internet.url }
let(:updater) { double }
before do
allow(updater).to receive(:call)
end
it "calls the service" do
described_class.perform_now(episode.id, url, updater)
expect(updater).to have_received(:call).with(episode, url).once
end
it "doesn't call the service when the podcast is not found" do
described_class.perform_now(PodcastEpisode.maximum(:id).to_i + 1, url, updater)
expect(updater).not_to have_received(:call)
end
end
end