You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
asciinema.org/spec/workers/asciicast_worker_spec.rb

25 lines
613 B
Ruby

require 'rails_helper'
describe AsciicastWorker do
let(:worker) { described_class.new }
describe '#perform' do
let(:asciicast) { double('asciicast') }
let(:asciicast_processor) { double('asciicast_processor', :process => nil) }
before do
allow(Asciicast).to receive(:find).with(123) { asciicast }
allow(AsciicastProcessor).to receive(:new).
with(no_args) { asciicast_processor }
end
it 'processes given asciicast with AsciicastProcessor' do
worker.perform(123)
expect(asciicast_processor).to have_received(:process).with(asciicast)
end
end
end