Sha256: ab62ef8d62655523e637a35f05492944a29ba655ec575f0b3ab9f74d28c87b67

Contents?: true

Size: 1.4 KB

Versions: 26

Compression:

Stored size: 1.4 KB

Contents

require 'spec_helper'

describe 'spotlight/searches/_search.html.erb', type: :view do
  let(:search) do
    FactoryGirl.build_stubbed(:search, exhibit: FactoryGirl.create(:exhibit),
                                       id: 99,
                                       title: 'Title1',
                                       query_params: {
                                         f: {
                                           genre_ssim: ['xyz']
                                         }
                                       })
  end

  before do
    allow(view).to receive(:edit_search_path).and_return('/edit')
    allow(view).to receive(:search_path).and_return('/search')
    allow(search).to receive_message_chain(:thumbnail, :image, thumb: '/some/image')
    allow(search).to receive(:count).and_return(15)
    allow(search).to receive(:params).and_return({})

    form_for(search, url: '/update') do |f|
      @f = f
    end
  end

  it 'renders a list of pages' do
    # rubocop:disable RSpec/InstanceVariable
    render partial: 'spotlight/searches/search', locals: { f: @f }
    # rubocop:enable RSpec/InstanceVariable
    expect(rendered).to have_selector "li[data-id='99']"
    expect(rendered).to have_selector '.panel-heading .main .title', text: 'Title1'
    expect(rendered).to have_selector 'img[src="/some/image"]'
    expect(rendered).to have_selector 'input[type=hidden][data-property=weight]'
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

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