Sha256: 0c3711ab7f13879b6c9fb102cfa5a23f3fb697448fd347574a33ced24793b614

Contents?: true

Size: 789 Bytes

Versions: 24

Compression:

Stored size: 789 Bytes

Contents

require 'spec_helper'
require 'celluloid'
require 'writefully/tools'
require 'writefully/workers'

module Writefully
  module Workers
    describe Journalist do 
      let(:message) { { resource: 'posts', slug: '1-hash-selector-pattern' } }
      let(:message_with_tries) { message.merge({tries: 2, run: false}) }
      let(:pencil) { double("Pencil", perform: true) }
      subject(:journalist) { Journalist.new }

      before do 
        Journalist.any_instance.stub(:message).and_return(message)
        Tools::Pencil.stub(:new_link).and_return(pencil)
      end

      its(:message_with_tries) { should eq message_with_tries }

      it "#publish" do 
        pencil.should_receive(:perform).once
        subject.publish
      end

      after { subject.terminate }

    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
writefully-0.8.2 spec/lib/writefully/workers/journalist_spec.rb
writefully-0.8.1 spec/lib/writefully/workers/journalist_spec.rb
writefully-0.8.0 spec/lib/writefully/workers/journalist_spec.rb
writefully-0.7.1 spec/lib/writefully/workers/journalist_spec.rb
writefully-0.6.12 spec/lib/writefully/workers/journalist_spec.rb
writefully-0.6.11 spec/lib/writefully/workers/journalist_spec.rb
writefully-0.6.10 spec/lib/writefully/workers/journalist_spec.rb
writefully-0.6.9 spec/lib/writefully/workers/journalist_spec.rb
writefully-0.6.7 spec/lib/writefully/workers/journalist_spec.rb
writefully-0.6.6 spec/lib/writefully/workers/journalist_spec.rb
writefully-0.6.5 spec/lib/writefully/workers/journalist_spec.rb
writefully-0.6.4 spec/lib/writefully/workers/journalist_spec.rb
writefully-0.6.3 spec/lib/writefully/workers/journalist_spec.rb
writefully-0.6.2 spec/lib/writefully/workers/journalist_spec.rb
writefully-0.5.1 spec/lib/writefully/workers/journalist_spec.rb
writefully-0.5.0 spec/lib/writefully/workers/journalist_spec.rb
writefully-0.4.10 spec/lib/writefully/workers/journalist_spec.rb
writefully-0.4.8 spec/lib/writefully/workers/journalist_spec.rb
writefully-0.4.7 spec/lib/writefully/workers/journalist_spec.rb
writefully-0.4.6 spec/lib/writefully/workers/journalist_spec.rb