Sha256: 0b24bb56a9e3ede7fec650b91139d5d238f5cacc5f9a3b89e390f125a2a9d86d

Contents?: true

Size: 958 Bytes

Versions: 21

Compression:

Stored size: 958 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]\nN+1 Query method call 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]\nN+1 Query method call stack\n  caller1\n  caller2\n", "  Post => [:comments, :votes]\n  Add to your finder: :includes => [:comments, :votes]\nN+1 Query method call 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("N+1 Query in path") }
    end
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
bullet-5.4.3 spec/bullet/notification/n_plus_one_query_spec.rb
bullet-5.4.2 spec/bullet/notification/n_plus_one_query_spec.rb
bullet-5.4.1 spec/bullet/notification/n_plus_one_query_spec.rb
bullet-5.4.0 spec/bullet/notification/n_plus_one_query_spec.rb
bullet-5.3.0 spec/bullet/notification/n_plus_one_query_spec.rb
bullet-5.2.1 spec/bullet/notification/n_plus_one_query_spec.rb
bullet-5.2.0 spec/bullet/notification/n_plus_one_query_spec.rb
bullet-5.1.1 spec/bullet/notification/n_plus_one_query_spec.rb
bullet-5.1.0 spec/bullet/notification/n_plus_one_query_spec.rb
bullet-5.0.0 spec/bullet/notification/n_plus_one_query_spec.rb
bullet-4.14.10 spec/bullet/notification/n_plus_one_query_spec.rb
bullet-4.14.9 spec/bullet/notification/n_plus_one_query_spec.rb
bullet-4.14.8 spec/bullet/notification/n_plus_one_query_spec.rb
bullet_instructure-4.14.8 spec/bullet/notification/n_plus_one_query_spec.rb
bullet-4.14.7 spec/bullet/notification/n_plus_one_query_spec.rb
bullet_instructure-4.14.7 spec/bullet/notification/n_plus_one_query_spec.rb
bullet-4.14.6 spec/bullet/notification/n_plus_one_query_spec.rb
bullet-4.14.5 spec/bullet/notification/n_plus_one_query_spec.rb
bullet-4.14.4 spec/bullet/notification/n_plus_one_query_spec.rb
bullet-4.14.3 spec/bullet/notification/n_plus_one_query_spec.rb