Sha256: 8cd796480148e397fa5f198daf8e437cf924b56fca0356f186a383276ed7c5a5

Contents?: true

Size: 662 Bytes

Versions: 13

Compression:

Stored size: 662 Bytes

Contents

require 'spec_helper'
require 'materialist/event_worker'

RSpec.describe Materialist::EventWorker do
  describe "#perform" do
    let(:source_url) { 'https://service.dev/foobars/1' }
    let(:event) {{ 'topic' => :foobar, 'url' => source_url, 'type' => 'noop' }}
    let!(:materializer_class) { class FoobarMaterializer; end }

    before do
      allow(FoobarMaterializer).to receive(:perform)
    end

    context "when run synchronously" do
      let(:perform) { subject.perform(event) }

      it "calls the relevant materializer" do
        expect(FoobarMaterializer).to receive(:perform).with(source_url, :noop)
        perform
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
materialist-2.3.1 spec/materialist/event_worker_spec.rb
materialist-2.3.0 spec/materialist/event_worker_spec.rb
materialist-2.2.0 spec/materialist/event_worker_spec.rb
materialist-2.1.0 spec/materialist/event_worker_spec.rb
materialist-2.0.0 spec/materialist/event_worker_spec.rb
materialist-1.0.0 spec/materialist/event_worker_spec.rb
materialist-0.1.0 spec/materialist/event_worker_spec.rb
materialist-0.0.6 spec/materialist/event_worker_spec.rb
materialist-0.0.5 spec/materialist/event_worker_spec.rb
materialist-0.0.4 spec/materialist/event_worker_spec.rb
materialist-0.0.3 spec/materialist/event_worker_spec.rb
materialist-0.0.2 spec/materialist/event_worker_spec.rb
materialist-0.0.1 spec/materialist/event_worker_spec.rb