Sha256: 8fa11a40573779a2993f01acce0a7a457dcfca8ca4c179e6313cc659c5c4b1e1

Contents?: true

Size: 913 Bytes

Versions: 36

Compression:

Stored size: 913 Bytes

Contents

# frozen_string_literal: true

describe "Blacklight::Document::Email" do
  before(:all) do
    SolrDocument.use_extension( Blacklight::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
    expect(sms_text).to 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
    expect(sms_text).to match(/My Title/)
    expect(sms_text).to_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"})
    expect(doc.to_sms_text).to be_nil
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
blacklight-6.25.0 spec/models/blacklight/document/sms_spec.rb
blacklight-6.24.0 spec/models/blacklight/document/sms_spec.rb
blacklight-6.23.0 spec/models/blacklight/document/sms_spec.rb
blacklight-6.22.0 spec/models/blacklight/document/sms_spec.rb
blacklight-6.21.0 spec/models/blacklight/document/sms_spec.rb
blacklight-6.20.0 spec/models/blacklight/document/sms_spec.rb
blacklight-6.19.2 spec/models/blacklight/document/sms_spec.rb
blacklight-6.19.1 spec/models/blacklight/document/sms_spec.rb
blacklight-6.19.0 spec/models/blacklight/document/sms_spec.rb
blacklight-6.18.0 spec/models/blacklight/document/sms_spec.rb
blacklight-6.17.0 spec/models/blacklight/document/sms_spec.rb
blacklight-6.16.0 spec/models/blacklight/document/sms_spec.rb
blacklight-6.15.0 spec/models/blacklight/document/sms_spec.rb
blacklight-6.14.1 spec/models/blacklight/document/sms_spec.rb
blacklight-6.14.0 spec/models/blacklight/document/sms_spec.rb
blacklight-6.13.0 spec/models/blacklight/document/sms_spec.rb
blacklight-6.12.0 spec/models/blacklight/document/sms_spec.rb
blacklight-6.11.2 spec/models/blacklight/document/sms_spec.rb
blacklight-6.11.1 spec/models/blacklight/document/sms_spec.rb
blacklight-6.11.0 spec/models/blacklight/document/sms_spec.rb