Sha256: d281baaf55d9e7f1d97f9dcf7caeb0e623c807655d2230edae2a6bc398dd7a9e

Contents?: true

Size: 854 Bytes

Versions: 10

Compression:

Stored size: 854 Bytes

Contents

require 'spec_helper'

describe Alephant::Publisher::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::SQSHelper::Archiver.new(c, false)

      instance.see(m)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
alephant-publisher-0.6.10 spec/archiver_spec.rb
alephant-publisher-0.6.9 spec/archiver_spec.rb
alephant-publisher-0.6.8 spec/archiver_spec.rb
alephant-publisher-0.6.7 spec/archiver_spec.rb
alephant-publisher-0.6.6 spec/archiver_spec.rb
alephant-publisher-0.6.5 spec/archiver_spec.rb
alephant-publisher-0.6.4 spec/archiver_spec.rb
alephant-publisher-0.6.3 spec/archiver_spec.rb
alephant-publisher-0.6.2 spec/archiver_spec.rb
alephant-publisher-0.6.1 spec/archiver_spec.rb