Sha256: f1b758852b3d262db04df981338d05d56f616a2eeac9688f0530d36850528d8d

Contents?: true

Size: 1.38 KB

Versions: 22

Compression:

Stored size: 1.38 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
    provider_agent = provider.agent
    provider_agent.label = provider.name

    aggregation = build(:aggregation, provider: provider_agent)
    aggregation.set_subject! 'moomin'
    aggregation
  end

  let(:provider) { build(:krikri_provider) }
end

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

    let(:empty) do
      provider_agent = provider.agent
      provider_agent.label = provider.name

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

    let(:empty_new_provider) do
      provider_agent = build(:krikri_provider, 
                             rdf_subject: 'http://example.com/fake').agent

      aggregation = build(:aggregation,
                          provider: provider_agent,
                          sourceResource: nil)
      aggregation.set_subject! 'empty_new_provider'
      aggregation
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
krikri-0.12.0 spec/support/shared_contexts/indexed_item.rb
krikri-0.12.0.pre.rc.1 spec/support/shared_contexts/indexed_item.rb
krikri-0.11.2 spec/support/shared_contexts/indexed_item.rb
krikri-0.11.1 spec/support/shared_contexts/indexed_item.rb
krikri-0.11.0 spec/support/shared_contexts/indexed_item.rb
krikri-0.10.1 spec/support/shared_contexts/indexed_item.rb
krikri-0.10.0 spec/support/shared_contexts/indexed_item.rb
krikri-0.9.0 spec/support/shared_contexts/indexed_item.rb
krikri-0.8.9 spec/support/shared_contexts/indexed_item.rb
krikri-0.8.8 spec/support/shared_contexts/indexed_item.rb
krikri-0.8.7 spec/support/shared_contexts/indexed_item.rb
krikri-0.8.6 spec/support/shared_contexts/indexed_item.rb
krikri-0.8.5 spec/support/shared_contexts/indexed_item.rb
krikri-0.8.4 spec/support/shared_contexts/indexed_item.rb
krikri-0.8.3 spec/support/shared_contexts/indexed_item.rb
krikri-0.8.2 spec/support/shared_contexts/indexed_item.rb
krikri-0.8.1 spec/support/shared_contexts/indexed_item.rb
krikri-0.8.0 spec/support/shared_contexts/indexed_item.rb
krikri-0.7.6 spec/support/shared_contexts/indexed_item.rb
krikri-0.7.5 spec/support/shared_contexts/indexed_item.rb