Sha256: 131cc61b0429d1ab5e9f31dbe9af6eef75df52fe5d36106b82d8b3686a532111

Contents?: true

Size: 781 Bytes

Versions: 2

Compression:

Stored size: 781 Bytes

Contents

require 'acceptance/spec_helper'

describe 'Indexing', :live => true do
  it "does not index files where the temp file exists" do
    path = Rails.root.join('db/sphinx/test/ts-article_core.tmp')
    FileUtils.mkdir_p Rails.root.join('db/sphinx/test')
    FileUtils.touch path

    article = Article.create! :title => 'Pancakes'
    index 'article_core'
    Article.search.should be_empty

    FileUtils.rm path
  end

  it "indexes files when other indices are already being processed" do
    path = Rails.root.join('db/sphinx/test/ts-book_core.tmp')
    FileUtils.mkdir_p Rails.root.join('db/sphinx/test')
    FileUtils.touch path

    article = Article.create! :title => 'Pancakes'
    index 'article_core'
    Article.search.should_not be_empty

    FileUtils.rm path
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
thinking-sphinx-3.1.1 spec/acceptance/indexing_spec.rb
thinking-sphinx-3.1.0 spec/acceptance/indexing_spec.rb