Sha256: 4d84adf2afe5afb3d9ed92e65513d8c7c2683b8220b1ae5311b14c031ca714ba

Contents?: true

Size: 909 Bytes

Versions: 4

Compression:

Stored size: 909 Bytes

Contents

require 'spec_helper'

module Bullet
  module Notification
    describe NPlusOneQuery do
      subject { NPlusOneQuery.new([%w[caller1 caller2]], Post, %i[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

4 entries across 4 versions & 1 rubygems

Version Path
bullet-5.7.4 spec/bullet/notification/n_plus_one_query_spec.rb
bullet-5.7.3 spec/bullet/notification/n_plus_one_query_spec.rb
bullet-5.7.2 spec/bullet/notification/n_plus_one_query_spec.rb
bullet-5.7.1 spec/bullet/notification/n_plus_one_query_spec.rb