Sha256: f7e5863d3fc6ad9002362e36db9c0112345587a5d2354a31fa1d9c345e997390
Contents?: true
Size: 881 Bytes
Versions: 22
Compression:
Stored size: 881 Bytes
Contents
# frozen_string_literal: true RSpec.describe "Blacklight::Document::Email" do before(:all) do SolrDocument.use_extension(Blacklight::Document::Sms) end it "onlies return values that are available in the field semantics" do doc = SolrDocument.new(id: "1234", title_tsim: "My Title", author_tsim: "Joe Schmoe") sms_text = doc.to_sms_text expect(sms_text).to match(/My Title by Joe Schmoe/) end it "handles multi-values fields correctly and only take the first" do doc = SolrDocument.new(id: "1234", title_tsim: ["My Title", "My Alt. Title"]) sms_text = doc.to_sms_text expect(sms_text).to match(/My Title/) expect(sms_text).not_to match(/My Alt\. Title/) end it "returns 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
22 entries across 22 versions & 1 rubygems