Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Commit

Permalink
Add Replay link; Resolves #19
Browse files Browse the repository at this point in the history
* 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
ruebot committed Oct 18, 2017
1 parent 0b45717 commit 4358721
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/models/solr_document.rb
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
17 changes: 17 additions & 0 deletions spec/models/concerns/warclight/solr_document_spec.rb
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

0 comments on commit 4358721

Please sign in to comment.