Sha256: 3ceaf1389de981506fa74ad2e3ca712bea15eab779ac6a5cd9fcaa1e1fa154ab

Contents?: true

Size: 814 Bytes

Versions: 26

Compression:

Stored size: 814 Bytes

Contents

# frozen_string_literal: true

RSpec.describe "catalog/show.json" do
  let(:document) do
    SolrDocument.new(id: '123', title_tsim: 'Book1', author_tsim: 'Julie', format: 'Book')
  end
  let(:config) do
    Blacklight::Configuration.new do |config|
      config.show.title_field = 'title_tsim'
    end
  end

  let(:hash) do
    render template: "catalog/show", formats: [:json]
    JSON.parse(rendered).with_indifferent_access
  end

  before do
    allow(view).to receive(:blacklight_config).and_return(config)
    allow(view).to receive(:action_name).and_return('show')
    assign :document, document
  end

  it "includes document attributes" do
    expect(hash).to include(data:
      {
        id: '123',
        type: 'Book',
        attributes: {
          'title' => 'Book1'
        }
      })
  end
end

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
blacklight-7.40.0 spec/views/catalog/show.json.jbuilder_spec.rb
blacklight-7.39.0 spec/views/catalog/show.json.jbuilder_spec.rb
blacklight-7.38.0 spec/views/catalog/show.json.jbuilder_spec.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-7.37.0/spec/views/catalog/show.json.jbuilder_spec.rb
blacklight-8.2.2 spec/views/catalog/show.json.jbuilder_spec.rb
blacklight-8.2.1 spec/views/catalog/show.json.jbuilder_spec.rb
blacklight-8.2.0 spec/views/catalog/show.json.jbuilder_spec.rb
blacklight-7.37.0 spec/views/catalog/show.json.jbuilder_spec.rb
blacklight-7.36.2 spec/views/catalog/show.json.jbuilder_spec.rb
blacklight-7.36.1 spec/views/catalog/show.json.jbuilder_spec.rb
blacklight-7.36.0 spec/views/catalog/show.json.jbuilder_spec.rb
blacklight-7.35.0 spec/views/catalog/show.json.jbuilder_spec.rb
blacklight-8.1.0 spec/views/catalog/show.json.jbuilder_spec.rb
blacklight-7.34.0 spec/views/catalog/show.json.jbuilder_spec.rb
blacklight-8.0.1 spec/views/catalog/show.json.jbuilder_spec.rb
blacklight-8.0.0 spec/views/catalog/show.json.jbuilder_spec.rb
blacklight-8.0.0.beta8 spec/views/catalog/show.json.jbuilder_spec.rb
blacklight-8.0.0.beta7 spec/views/catalog/show.json.jbuilder_spec.rb
blacklight-8.0.0.beta6 spec/views/catalog/show.json.jbuilder_spec.rb
blacklight-8.0.0.beta5 spec/views/catalog/show.json.jbuilder_spec.rb