Sha256: 5624ec5f5077f3fb9f2698c2df5b3361baaa226f6ff799f5f4deab237d3e6f93

Contents?: true

Size: 992 Bytes

Versions: 12

Compression:

Stored size: 992 Bytes

Contents

# frozen_string_literal: true
RSpec.shared_examples 'a Valkyrie::Persistence::Solr::Indexer' do |*_flags|
  let(:created_at) { Time.now.utc }
  let(:attributes) do
    {
      created_at: created_at,
      internal_resource: 'Resource',
      title: ["Test", RDF::Literal.new("French", language: :fr)],
      author: ["Author"],
      creator: "Creator"
    }
  end
  let(:resource) do
    Resource.new(
      id: "1",
      internal_resource: 'Resource',
      attributes: attributes
    )
  end
  let(:indexer) { described_class.new(resource: resource) }

  before do
    class Resource < Valkyrie::Resource
      attribute :title, Valkyrie::Types::Set
      attribute :author, Valkyrie::Types::Set
      attribute :birthday, Valkyrie::Types::DateTime.optional
      attribute :creator, Valkyrie::Types::String
    end
  end

  after do
    Object.send(:remove_const, :Resource)
  end

  describe '#to_solr' do
    subject { indexer.to_solr }

    it { is_expected.to be_a Hash }
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
valkyrie-2.0.0.RC3 lib/valkyrie/specs/shared_specs/solr_indexer.rb
valkyrie-1.5.0 lib/valkyrie/specs/shared_specs/solr_indexer.rb
valkyrie-1.5.0.RC2 lib/valkyrie/specs/shared_specs/solr_indexer.rb
valkyrie-1.5.0.RC1 lib/valkyrie/specs/shared_specs/solr_indexer.rb
valkyrie-2.0.0.RC1 lib/valkyrie/specs/shared_specs/solr_indexer.rb
valkyrie-1.4.0 lib/valkyrie/specs/shared_specs/solr_indexer.rb
valkyrie-1.3.0 lib/valkyrie/specs/shared_specs/solr_indexer.rb
valkyrie-1.2.2 lib/valkyrie/specs/shared_specs/solr_indexer.rb
valkyrie-1.2.1 lib/valkyrie/specs/shared_specs/solr_indexer.rb
valkyrie-1.2.0 lib/valkyrie/specs/shared_specs/solr_indexer.rb
valkyrie-1.2.0.rc3 lib/valkyrie/specs/shared_specs/solr_indexer.rb
valkyrie-1.2.0.rc2 lib/valkyrie/specs/shared_specs/solr_indexer.rb