Sha256: d9d2ee8bf8f661701bf68c5f745513cc8ccb7260a4e2bff5181f0aa40746d6e6

Contents?: true

Size: 868 Bytes

Versions: 12

Compression:

Stored size: 868 Bytes

Contents

require 'spec_helper'

describe Alephant::Publisher::Queue::SQSHelper::Archiver do
  describe "#see" do
    it "calls cache put with the correct params" do
      time_now = DateTime.parse("Feb 24 1981")
      allow(DateTime).to receive(:now).and_return(time_now)

      q = double("queue").as_null_object
      c = double("cache").as_null_object

      expect(q).to receive(:url).and_return('url')

      m = Struct.new(:id, :body, :md5, :queue).new('id', 'body', 'md5', q)

      expect(c).to receive(:put).with(
        "archive/#{time_now.strftime('%d-%m-%Y_%H')}/id",
        "body",
        {
          :id        => "id",
          :md5       => "md5",
          :logged_at => time_now.to_s,
          :queue     => "url"
        }
      )

      instance = Alephant::Publisher::Queue::SQSHelper::Archiver.new(c, false)

      instance.see(m)
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
alephant-publisher-queue-1.3.6 spec/archiver_spec.rb
alephant-publisher-queue-1.3.5 spec/archiver_spec.rb
alephant-publisher-queue-1.3.4 spec/archiver_spec.rb
alephant-publisher-queue-1.3.3 spec/archiver_spec.rb
alephant-publisher-queue-1.3.2 spec/archiver_spec.rb
alephant-publisher-queue-1.2.2 spec/archiver_spec.rb
alephant-publisher-queue-1.2.1 spec/archiver_spec.rb
alephant-publisher-queue-1.2.0 spec/archiver_spec.rb
alephant-publisher-queue-1.1.0 spec/archiver_spec.rb
alephant-publisher-queue-1.0.0 spec/archiver_spec.rb
alephant-publisher-queue-0.1.0 spec/archiver_spec.rb
alephant-publisher-queue-0.0.1 spec/archiver_spec.rb