This repository has been archived by the owner on Jun 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create an accessor that uses to Solr fields to query Time Travel API * Display accessor as a field * Create a test * Update Rubocop to ignore somethings; TODO create tickets, and come back to this later
- Loading branch information
Showing
2 changed files
with
25 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# frozen_string_literal: true | ||
class SolrDocument | ||
include Blacklight::Solr::Document | ||
|
||
def playback_link | ||
"hello blacklight" | ||
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 |
---|---|---|
@@ -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 '<a href="https://digital.library.yorku.ca/wayback/20150113163601/http://www.library.yorku.ca/cms/steacie/about-the-library/hackfest/" target="_blank">https://digital.library.yorku.ca/wayback/20150113163601/http://www.library.yorku.ca/cms/steacie/about-the-library/hackfest/</a> 🔗' | ||
end | ||
end | ||
end |