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