Sha256: 7ccbbb7429db59651559c74e612d00a7c14963cc83e961a0ac0e45c50a56367b

Contents?: true

Size: 541 Bytes

Versions: 5

Compression:

Stored size: 541 Bytes

Contents

require 'spec_helper'

RSpec.describe Counter::Cache do
  describe '.included' do
    let(:counter) { double(:counter) }
    let(:clazz) { Class.new { include Counter::Cache } }

    it 'listens to the after_create and after_destroy' do
      expect(clazz).to receive(:after_create).with(an_instance_of(Counter::Cache::ActiveRecordUpdater)).once { true }
      expect(clazz).to receive(:after_destroy).with(an_instance_of(Counter::Cache::ActiveRecordUpdater)).once { true }
      clazz.counter_cache_on :counter => counter
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

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