Sha256: 695ee8f99c059d637f03f3ff5f4f3ae75e0903ee3f191ed2592d884ea8a8cf7e

Contents?: true

Size: 1.08 KB

Versions: 26

Compression:

Stored size: 1.08 KB

Contents

require 'spec_helper'

module Spotlight
  describe 'spotlight/metadata_configurations/_metadata_field', type: :view do
    let(:exhibit) { FactoryGirl.create(:exhibit) }
    let(:p) { 'spotlight/metadata_configurations/metadata_field.html.erb' }
    before do
      assign(:exhibit, exhibit)
      assign(:blacklight_configuration, exhibit.blacklight_configuration)
      allow(view).to receive_messages(
        current_exhibit: exhibit,
        blacklight_config: exhibit.blacklight_configuration,
        available_view_fields: { some_view_type: 1, another_view_type: 2 },
        select_deselect_button: nil)
    end

    let(:facet_field) { Blacklight::Configuration::FacetField.new }
    let(:builder) { ActionView::Helpers::FormBuilder.new 'z', nil, view, {} }

    it 'uses the index_field_label helper to render the label' do
      allow(view).to receive(:index_field_label).with(nil, 'some_key').and_return 'Some label'
      render partial: p, locals: { key: 'some_key', config: facet_field, f: builder }
      expect(rendered).to have_selector '.field-label', text: 'Some label'
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
blacklight-spotlight-0.17.1 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.17.0 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.16.0 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.15.0 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.14.2 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.14.1 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.14.0 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.13.0 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.12.1 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.12.0 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.11.0 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.10.3 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.10.2 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.10.1 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.10.0 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.9.2 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.9.1 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.9.0 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.8.2 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.8.1 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb