Sha256: 3f8f505bd76a8fb275f720ac7139530c31688ca25bad3391a9b5ac1cf5fee0af

Contents?: true

Size: 975 Bytes

Versions: 49

Compression:

Stored size: 975 Bytes

Contents

# -*- encoding : utf-8 -*-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe "Blacklight::Solr::Document::Email" do
  before(:all) do
    SolrDocument.use_extension( Blacklight::Solr::Document::Sms )
  end
  it "should only return values that are available in the field semantics" do
    doc = SolrDocument.new({:id=>"1234", :title_display=>"My Title", :author_display=>"Joe Schmoe"})
    sms_text = doc.to_sms_text
    sms_text.should match(/My Title by Joe Schmoe/)
  end
  it "should handle multi-values fields correctly and only take the first" do
    doc = SolrDocument.new({:id=>"1234", :title_display=>["My Title", "My Alt. Title"]})
    sms_text = doc.to_sms_text
    sms_text.should match(/My Title/)
    sms_text.should_not match(/My Alt\. Title/)
  end
  it "should return nil if there are no valid field semantics to build the email body from" do
    doc = SolrDocument.new({:id=>"1234"})
    doc.to_sms_text.should be_nil
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
blacklight-4.7.0 spec/lib/blacklight_sms_spec.rb
blacklight-4.7.0.pre1 spec/lib/blacklight_sms_spec.rb
blacklight-4.6.3 spec/lib/blacklight_sms_spec.rb
blacklight-4.6.2 spec/lib/blacklight_sms_spec.rb
blacklight-4.6.1 spec/lib/blacklight_sms_spec.rb
blacklight-5.0.0.pre1 spec/lib/blacklight_sms_spec.rb
blacklight-4.6.0 spec/lib/blacklight_sms_spec.rb
blacklight-4.5.0 spec/lib/blacklight_sms_spec.rb
blacklight-4.5.0.rc1 spec/lib/blacklight_sms_spec.rb
blacklight-4.4.2 spec/lib/blacklight_sms_spec.rb
blacklight-4.4.1 spec/lib/blacklight_sms_spec.rb
blacklight-4.4.0 spec/lib/blacklight_sms_spec.rb
blacklight-4.3.0 spec/lib/blacklight_sms_spec.rb
blacklight-4.2.2 spec/lib/blacklight_sms_spec.rb
blacklight-4.2.1 spec/lib/blacklight_sms_spec.rb
blacklight-4.2.0 spec/lib/blacklight_sms_spec.rb
blacklight-4.1.0 test_support/spec/lib/blacklight_sms_spec.rb
blacklight-4.0.1 test_support/spec/lib/blacklight_sms_spec.rb
blacklight-3.8.2 test_support/spec/lib/blacklight_sms_spec.rb
blacklight-4.0.0 test_support/spec/lib/blacklight_sms_spec.rb