Sha256: fc047d45715facd8633903c49a633eceeac76cc5f90daf02cc60cb7a8229f0f2

Contents?: true

Size: 1.01 KB

Versions: 23

Compression:

Stored size: 1.01 KB

Contents

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

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
blacklight-spotlight-0.32.0 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.31.0 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.30.0 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.29.1 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.29.0 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.28.3 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.28.2 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.28.1 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.28.0 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.27.0 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.26.1 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.26.0 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.25.0 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.24.0 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.23.0 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.22.0 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.21.0 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.20.3 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.20.2 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb
blacklight-spotlight-0.20.1 spec/views/spotlight/metadata_configurations/_metadata_field.html.erb_spec.rb