diff --git a/app/models/solr_document.rb b/app/models/solr_document.rb new file mode 100644 index 0000000..0070f0f --- /dev/null +++ b/app/models/solr_document.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true +class SolrDocument + include Blacklight::Solr::Document + + def playback_link + "hello blacklight" + end +end diff --git a/spec/models/concerns/warclight/solr_document_spec.rb b/spec/models/concerns/warclight/solr_document_spec.rb new file mode 100644 index 0000000..398b4f5 --- /dev/null +++ b/spec/models/concerns/warclight/solr_document_spec.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe Warclight::SolrDocument do + let(:document) { SolrDocument.new } + + describe '#replay_link' do + let(:document) do + SolrDocument.new(crawl_date: '2015-01-13T16:36:01Z', url: 'http://www.library.yorku.ca/cms/steacie/about-the-library/hackfest/') + end + + it 'writes a replay url based on memento time travel response' do + expect(document.replay_link).to eq 'https://digital.library.yorku.ca/wayback/20150113163601/http://www.library.yorku.ca/cms/steacie/about-the-library/hackfest/ 🔗' + end + end +end