asciinema.org/spec/workers/asciicast_worker_spec.rb

25 lines
613 B
Ruby
Raw Normal View History

2014-08-30 17:38:47 +00:00
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 }
2013-09-21 11:11:36 +00:00
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