Sha256: 39bf0448e2ab53f76bb32b67ad4816281cc80e2357931ab8c771d21c988464c8

Contents?: true

Size: 503 Bytes

Versions: 17

Compression:

Stored size: 503 Bytes

Contents

# frozen_string_literal: true

require 'acceptance/spec_helper'

describe 'Get search result counts', :live => true do
  it "returns counts for a single model" do
    4.times { |i| Article.create :title => "Article #{i}" }
    index

    expect(Article.search_count).to eq(4)
  end

  it "returns counts across all models" do
    3.times { |i| Article.create :title => "Article #{i}" }
    2.times { |i| Book.create :title => "Book #{i}" }
    index

    expect(ThinkingSphinx.count).to eq(5)
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
thinking-sphinx-5.6.0 spec/acceptance/search_counts_spec.rb
thinking-sphinx-5.5.1 spec/acceptance/search_counts_spec.rb
thinking-sphinx-5.5.0 spec/acceptance/search_counts_spec.rb
thinking-sphinx-5.4.0 spec/acceptance/search_counts_spec.rb
thinking-sphinx-5.3.0 spec/acceptance/search_counts_spec.rb
thinking-sphinx-5.2.1 spec/acceptance/search_counts_spec.rb
thinking-sphinx-5.2.0 spec/acceptance/search_counts_spec.rb
thinking-sphinx-5.1.0 spec/acceptance/search_counts_spec.rb
thinking-sphinx-5.0.0 spec/acceptance/search_counts_spec.rb
thinking-sphinx-4.4.1 spec/acceptance/search_counts_spec.rb
thinking-sphinx-4.4.0 spec/acceptance/search_counts_spec.rb
thinking-sphinx-4.3.2 spec/acceptance/search_counts_spec.rb
thinking-sphinx-4.3.1 spec/acceptance/search_counts_spec.rb
thinking-sphinx-4.3.0 spec/acceptance/search_counts_spec.rb
thinking-sphinx-4.2.0 spec/acceptance/search_counts_spec.rb
thinking-sphinx-4.1.0 spec/acceptance/search_counts_spec.rb
thinking-sphinx-4.0.0 spec/acceptance/search_counts_spec.rb