Sha256: f74920703a2270b7e4040af97e2edab021d4b6918f008f37c4ce227649019506

Contents?: true

Size: 1.16 KB

Versions: 22

Compression:

Stored size: 1.16 KB

Contents

# frozen_string_literal: true

describe 'spotlight/resources/new.html.erb', type: :view do
  let(:blacklight_config) { Blacklight::Configuration.new }
  let(:exhibit) { stub_model(Spotlight::Exhibit) }

  before do
    allow(view).to receive_messages(blacklight_config: blacklight_config)
    allow(view).to receive(:current_exhibit).and_return(exhibit)
    allow(view).to receive_messages(current_page?: true)
    stub_template 'spotlight/shared/_curation_sidebar.html.erb' => ''
  end

  it 'renders the configured partials' do
    allow(Spotlight::Engine.config).to receive(:resource_partials).and_return(
      %w[
        spotlight/resources/external_resources_form
        spotlight/resources/upload/form
        spotlight/resources/csv_upload/form
      ]
    )
    stub_template 'spotlight/resources/_external_resources_form.html.erb' => 'a_template'
    stub_template 'spotlight/resources/upload/_form.html.erb' => 'b_template'
    stub_template 'spotlight/resources/csv_upload/_form.html.erb' => 'c_template'
    render
    expect(rendered).to have_content 'a_template'
    expect(rendered).to have_content 'b_template'
    expect(rendered).to have_content 'c_template'
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
blacklight-spotlight-3.4.0 spec/views/spotlight/resources/new.html.erb_spec.rb
blacklight-spotlight-3.3.0 spec/views/spotlight/resources/new.html.erb_spec.rb
blacklight-spotlight-3.2.0 spec/views/spotlight/resources/new.html.erb_spec.rb
blacklight-spotlight-3.1.0 spec/views/spotlight/resources/new.html.erb_spec.rb
blacklight-spotlight-3.0.3 spec/views/spotlight/resources/new.html.erb_spec.rb
blacklight-spotlight-3.0.2 spec/views/spotlight/resources/new.html.erb_spec.rb
blacklight-spotlight-3.0.1 spec/views/spotlight/resources/new.html.erb_spec.rb
blacklight-spotlight-3.0.0 spec/views/spotlight/resources/new.html.erb_spec.rb
blacklight-spotlight-3.0.0.rc6 spec/views/spotlight/resources/new.html.erb_spec.rb
blacklight-spotlight-3.0.0.rc5 spec/views/spotlight/resources/new.html.erb_spec.rb
blacklight-spotlight-3.0.0.rc4 spec/views/spotlight/resources/new.html.erb_spec.rb
blacklight-spotlight-3.0.0.rc3 spec/views/spotlight/resources/new.html.erb_spec.rb
blacklight-spotlight-3.0.0.rc2 spec/views/spotlight/resources/new.html.erb_spec.rb
blacklight-spotlight-3.0.0.rc1 spec/views/spotlight/resources/new.html.erb_spec.rb
blacklight-spotlight-3.0.0.alpha.10 spec/views/spotlight/resources/new.html.erb_spec.rb
blacklight-spotlight-3.0.0.alpha.9 spec/views/spotlight/resources/new.html.erb_spec.rb
blacklight-spotlight-3.0.0.alpha.8 spec/views/spotlight/resources/new.html.erb_spec.rb
blacklight-spotlight-3.0.0.alpha.7 spec/views/spotlight/resources/new.html.erb_spec.rb
blacklight-spotlight-3.0.0.alpha.6 spec/views/spotlight/resources/new.html.erb_spec.rb
blacklight-spotlight-3.0.0.alpha.5 spec/views/spotlight/resources/new.html.erb_spec.rb