Sha256: 17ccdd23b9c6065f24881edfccb72f657895f6d1656713cef83974e5ec628b47

Contents?: true

Size: 1.48 KB

Versions: 26

Compression:

Stored size: 1.48 KB

Contents

require 'spec_helper'

describe 'spotlight/searches/edit.html.erb', type: :view do
  let(:blacklight_config) do
    Blacklight::Configuration.new do |config|
      config.add_facet_field :some_field
    end
  end
  let(:exhibit) { FactoryGirl.create(:exhibit) }
  let(:search) do
    stub_model(Spotlight::Search, exhibit: exhibit,
                                  id: 99, title: 'Title1', query_params: { f: { 'some_field' => ['xyz'] } })
  end
  before do
    allow(view).to receive(:search_action_path).and_return('/search')
    allow(view).to receive(:exhibit_search_path).and_return('/search')
    allow(view).to receive(:exhibit_searches_path).and_return('/searches')
    allow(view).to receive(:blacklight_config).and_return(blacklight_config)
    assign(:exhibit, exhibit)
    assign(:search, search)
    allow(view).to receive(:current_exhibit).and_return(exhibit)
    allow(view).to receive_messages(default_masthead_jcrop_options: {}, default_thumbnail_jcrop_options: {})
  end

  it 'renders a form w/ the appropriate autocomplete data attribute' do
    render
    expect(rendered).to have_selector 'form[data-autocomplete-exhibit-catalog-index-path]'
  end

  it 'renders active search constraints' do
    render
    expect(rendered).to have_selector '.appliedFilter .constraint-value'
    expect(rendered).to have_selector '.appliedFilter .constraint-value .filterName', text: 'Some Field'
    expect(rendered).to have_selector '.appliedFilter .constraint-value .filterValue', text: 'xyz'
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

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