Sha256: 8b6d9ac717055d24b3afad40020e6aa68129b7f1846853afc40fe020e9b6a85c

Contents?: true

Size: 663 Bytes

Versions: 19

Compression:

Stored size: 663 Bytes

Contents

require 'routemaster/event_index'
require 'spec/support/uses_redis'

describe Routemaster::EventIndex do
  uses_redis

  let(:cache) { Routemaster::Config.cache_redis }
  let(:url) { 'https://example.com/widgets/1234' }
  subject { described_class.new(url, cache: cache) }

  describe '#increment' do
    it 'increases #current' do
      expect {
        subject.increment
      }.to change {
        subject.current
      }.from(0).to(1)
    end

    it 'leaves all keys with TTLs' do
      subject.increment
      cache.redis.nodes.each do |node|
        node.keys.each do |key|
          expect(node.ttl(key)).to be > 0
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
routemaster-drain-3.7.1 spec/routemaster/event_index_spec.rb
routemaster-drain-3.7.0 spec/routemaster/event_index_spec.rb
routemaster-drain-3.6.8 spec/routemaster/event_index_spec.rb
routemaster-drain-3.6.7 spec/routemaster/event_index_spec.rb
routemaster-drain-3.6.6 spec/routemaster/event_index_spec.rb
routemaster-drain-3.6.5 spec/routemaster/event_index_spec.rb
routemaster-drain-3.6.4 spec/routemaster/event_index_spec.rb
routemaster-drain-3.6.3 spec/routemaster/event_index_spec.rb
routemaster-drain-3.6.2 spec/routemaster/event_index_spec.rb
routemaster-drain-3.6.1 spec/routemaster/event_index_spec.rb
routemaster-drain-3.6.0 spec/routemaster/event_index_spec.rb
routemaster-drain-3.5.1 spec/routemaster/event_index_spec.rb
routemaster-drain-3.5.0 spec/routemaster/event_index_spec.rb
routemaster-drain-3.4.0 spec/routemaster/event_index_spec.rb
routemaster-drain-3.3.0 spec/routemaster/event_index_spec.rb
routemaster-drain-3.2.0 spec/routemaster/event_index_spec.rb
routemaster-drain-3.1.0 spec/routemaster/event_index_spec.rb
routemaster-drain-3.0.3 spec/routemaster/event_index_spec.rb
routemaster-drain-3.0.2 spec/routemaster/event_index_spec.rb