-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
indexer setup, including fixes / tests for activefedoraconverter and …
…modeltransformer monograph indexer spec
- Loading branch information
Julie Allinson
committed
Jan 25, 2020
1 parent
ac568f8
commit 0b21d22
Showing
5 changed files
with
134 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'hyrax/specs/shared_specs' | ||
|
||
RSpec.describe MonographIndexer do | ||
let(:indexer) { described_class.new(resource: resource) } | ||
let(:resource) { build(:monograph) } | ||
let(:indexer_class) { described_class } | ||
let(:solr_document) { {} } # for now | ||
let(:change_set) { Hyrax::ChangeSet.for(resource) } | ||
|
||
it 'has resource' do | ||
expect(indexer.resource).to eq resource | ||
end | ||
|
||
context '#to_solr' do | ||
before do | ||
change_set.title = 'comet in moominland' | ||
This comment has been minimized.
Sorry, something went wrong.
no-reply
Contributor
|
||
change_set.creator = 'Tove Jansson' | ||
change_set.sync | ||
end | ||
|
||
it 'Indexes core_metadata' do | ||
expect(indexer.to_solr[:title_sim]).to eq resource.title | ||
expect(indexer.to_solr[:title_tesim]).to eq resource.title | ||
end | ||
|
||
it 'Indexes basic_metadata' do | ||
expect(indexer.to_solr[:creator_sim]).to eq resource.creator | ||
expect(indexer.to_solr[:creator_tesim]).to eq resource.creator | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,17 @@ | |
.to be_a indexer_class | ||
end | ||
end | ||
|
||
# Fails unless MonographIndexer has been pre-loaded | ||
This comment has been minimized.
Sorry, something went wrong.
no-reply
Contributor
|
||
context 'with registered Monograph indexer' do | ||
let(:resource) { build(:monograph) } | ||
let(:indexer_class) { MonographIndexer } | ||
|
||
it 'gives an instance of MonographIndexer for Monograph' do | ||
expect(described_class.for(resource: resource)) | ||
.to be_a indexer_class | ||
end | ||
end | ||
end | ||
|
||
describe "#to_solr" do | ||
|
is it worthwhile to alphabetize?