Sha256: a437f3bc1626554b069efa69ddb5ebe52aa2d862530ffe4fe6fc3e5b3d829fdb

Contents?: true

Size: 476 Bytes

Versions: 5

Compression:

Stored size: 476 Bytes

Contents

require 'spec_helper'

RSpec.describe Counter::Cache::Counters::BufferCounter::Key do
  let(:options) { double(relation_class_name: "Boo", relation: "boo", column: "boos_count", relation_id: nil) }
  let(:source_object) { double(boo_id: 1) }
  let(:key) { Counter::Cache::Counters::BufferCounter::Key.new(source_object, options) }

  describe '#to_s' do
    it 'returns the key with the class, id, and column' do
      expect(key.to_s).to eq("cc:Bo:1:boos")
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
counter-cache-0.3.0 spec/lib/counter/cache/buffer_counter/key_spec.rb
counter-cache-0.2.0 spec/lib/counter/cache/buffer_counter/key_spec.rb
counter-cache-0.1.0 spec/lib/counter/cache/buffer_counter/key_spec.rb
counter-cache-0.0.2 spec/lib/counter/cache/buffer_counter/key_spec.rb
counter-cache-0.0.1 spec/lib/counter/cache/buffer_counter/key_spec.rb