Sha256: bd30b1e727a937a44f399d42dbe7a8787067dc11a1cdaf01c7da2dd0ad3110d0

Contents?: true

Size: 915 Bytes

Versions: 3

Compression:

Stored size: 915 Bytes

Contents

require 'spec_helper'

module Bullet
  module Notification
    describe NPlusOneQuery do
      subject { NPlusOneQuery.new([["caller1", "caller2"]], Post, [:comments, :votes], "path") }

      it { expect(subject.body_with_caller).to eq("  Post => [:comments, :votes]\n  Add to your finder: :includes => [:comments, :votes]\nCall stack\n  caller1\n  caller2\n") }
      it { expect([subject.body_with_caller, subject.body_with_caller]).to eq([ "  Post => [:comments, :votes]\n  Add to your finder: :includes => [:comments, :votes]\nCall stack\n  caller1\n  caller2\n", "  Post => [:comments, :votes]\n  Add to your finder: :includes => [:comments, :votes]\nCall stack\n  caller1\n  caller2\n" ]) }
      it { expect(subject.body).to eq("  Post => [:comments, :votes]\n  Add to your finder: :includes => [:comments, :votes]") }
      it { expect(subject.title).to eq("USE eager loading in path") }
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bullet-5.6.0 spec/bullet/notification/n_plus_one_query_spec.rb
bullet-5.5.1 spec/bullet/notification/n_plus_one_query_spec.rb
bullet-5.5.0 spec/bullet/notification/n_plus_one_query_spec.rb