Sha256: a42545c3654c1c1da2f33a3930dd48a101aedf0ac473646c8549ff247c691c84
Contents?: true
Size: 1.08 KB
Versions: 7
Compression:
Stored size: 1.08 KB
Contents
# frozen_string_literal: true describe Blacklight::Rendering::Pipeline do include Capybara::RSpecMatchers let(:document) { instance_double(SolrDocument) } let(:context) { double } let(:options) { double } let(:presenter) { described_class.new(values, field_config, document, context, options) } describe "render" do subject { presenter.render } let(:values) { ['a', 'b'] } let(:field_config) { Blacklight::Configuration::NullField.new } it { is_expected.to eq "a and b" } context "when separator_options are in the config" do let(:values) { ['c', 'd'] } let(:field_config) { Blacklight::Configuration::NullField.new(separator: nil, itemprop: nil, separator_options: { two_words_connector: '; '}) } it { is_expected.to eq "c; d" } end context "when itemprop is in the config" do let(:values) { ['a'] } let(:field_config) { Blacklight::Configuration::NullField.new(separator: nil, itemprop: 'some-prop', separator_options: nil) } it { is_expected.to have_selector("span[@itemprop='some-prop']", :text => "a") } end end end
Version data entries
7 entries across 7 versions & 1 rubygems