Sha256: b60b4f35cab4a7ae7d0ff294bb38e89009a2366c2f3a285bee943292cb5b59f8

Contents?: true

Size: 1.11 KB

Versions: 9

Compression:

Stored size: 1.11 KB

Contents

shared_context 'with indexed item' do
  include_context 'clear repository'

  before do
    clear_search_index
    indexer = Krikri::QASearchIndex.new
    records.each { |rec| indexer.add rec.to_jsonld['@graph'].first }
    indexer.commit
  end

  after do
    clear_search_index
  end

  let(:records) { [agg] }

  let(:agg) do
    a = build(:aggregation)
    a.provider = provider
    a.set_subject! 'moomin'
    a
  end

  let(:provider) do
    build(:krikri_provider,
          rdf_subject: 'moomin_valley',
          label: 'moomin valley')
  end
end

shared_context 'with missing values' do
  include_context 'with indexed item' do
    let(:records) { [agg, empty, empty_new_provider] }

    let(:empty) do
      aggregation = build(:aggregation, provider: provider, sourceResource: nil)
      aggregation.set_subject! 'empty'
      aggregation
    end

    let(:empty_new_provider) do
      aggregation = build(:aggregation,
                          provider: RDF::URI('http://example.com/fake'),
                          sourceResource: nil)
      aggregation.set_subject! 'empty_new_provider'
      aggregation
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
krikri-0.7.2 spec/support/shared_contexts/indexed_item.rb
krikri-0.7.1 spec/support/shared_contexts/indexed_item.rb
krikri-0.7.0 spec/support/shared_contexts/indexed_item.rb
krikri-0.6.0 spec/support/shared_contexts/indexed_item.rb
krikri-0.5.7 spec/support/shared_contexts/indexed_item.rb
krikri-0.5.6 spec/support/shared_contexts/indexed_item.rb
krikri-0.5.5 spec/support/shared_contexts/indexed_item.rb
krikri-0.5.4 spec/support/shared_contexts/indexed_item.rb
krikri-0.5.3 spec/support/shared_contexts/indexed_item.rb