Sha256: 70ad1aa59efd2a937128b977acc8d6db3a9d7a0fdeeb6405549e3d77756c3b08

Contents?: true

Size: 780 Bytes

Versions: 1

Compression:

Stored size: 780 Bytes

Contents

# encoding: utf-8

require 'acceptance/spec_helper'

describe 'Accessing excerpts for methods on a search result', :live => true do
  it "returns excerpts for a given method" do
    Book.create! :title => 'American Gods', :year => 2001
    index

    search = Book.search('gods')
    search.context[:panes] << ThinkingSphinx::Panes::ExcerptsPane

    search.first.excerpts.title.
      should == 'American <span class="match">Gods</span>'
  end

  it "handles UTF-8 text for excerpts" do
    Book.create! :title => 'Война и миръ', :year => 1869
    index

    search = Book.search 'миръ'
    search.context[:panes] << ThinkingSphinx::Panes::ExcerptsPane

    search.first.excerpts.title.
      should == 'Война и <span class="match">миръ</span>'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
thinking-sphinx-3.0.3 spec/acceptance/excerpts_spec.rb