Sha256: 5c2a553fa7a68a9c97b3f2a4eb41ada264cb870376ec8a4d4c9cd729d797ed59

Contents?: true

Size: 940 Bytes

Versions: 8

Compression:

Stored size: 940 Bytes

Contents

# frozen_string_literal: true

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

8 entries across 8 versions & 1 rubygems

Version Path
bullet-6.0.2 spec/bullet/notification/n_plus_one_query_spec.rb
bullet-6.0.1 spec/bullet/notification/n_plus_one_query_spec.rb
bullet-6.0.0 spec/bullet/notification/n_plus_one_query_spec.rb
bullet-5.9.0 spec/bullet/notification/n_plus_one_query_spec.rb
bullet-5.8.1 spec/bullet/notification/n_plus_one_query_spec.rb
bullet-5.8.0 spec/bullet/notification/n_plus_one_query_spec.rb
bullet-5.7.6 spec/bullet/notification/n_plus_one_query_spec.rb
bullet-5.7.5 spec/bullet/notification/n_plus_one_query_spec.rb