Sha256: e6d7a7b58934e91851b41a57d305fe48dbb4b0b4f5789fe52b6259ee58eec708

Contents?: true

Size: 950 Bytes

Versions: 1

Compression:

Stored size: 950 Bytes

Contents

require 'spec_helper'

describe Spotlight::DocumentPresenter do
  let(:request_context) { double(:add_facet_params => '') }
  let(:document) { SolrDocument.new(document_attributes)}
  let(:config) do
    Blacklight::Configuration.new.configure do |config|
      config.index.title_field = 'full_title_tesim'
    end
  end

  subject { Spotlight::DocumentPresenter.new(document, request_context, config) }

  describe "#raw_document_heading" do
    describe "with an array" do
      let(:document_attributes) { { 'full_title_tesim' => ['Main title & stuff'] } }
      it "should not escape html" do
        expect(subject.raw_document_heading).to eq("Main title & stuff")
      end
    end

    describe "with a single value " do
      let(:document_attributes) { { 'full_title_tesim' => 'Main title & stuff' } }
      it "should not escape html" do
        expect(subject.raw_document_heading).to eq("Main title & stuff")
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
blacklight-spotlight-0.2.0 spec/lib/spotlight/document_presenter_spec.rb