Skip to content

Commit

Permalink
Fix formatter specs (#6365)
Browse files Browse the repository at this point in the history
* Fix formatter specs
  • Loading branch information
abelemlih authored Oct 17, 2023
1 parent 4f60343 commit d672a40
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
RSpec.describe Hyrax::CitationsBehaviors::Formatters::ApaFormatter do
subject(:formatter) { described_class.new(:no_context) }

let(:presenter) { Hyrax::WorkShowPresenter.new(SolrDocument.new(work.to_solr), :no_ability) }
let(:solr_document) do
if work.is_a? ActiveFedora::Base
SolrDocument.new(work.to_solr)
else
SolrDocument.new(GenericWorkIndexer.new(resource: work).to_solr)
end
end
let(:presenter) { Hyrax::WorkShowPresenter.new(solr_document, :no_ability) }
let(:work) { build(:generic_work, title: ['Title'], creator: []) }

it 'formats citations without creators' do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@
RSpec.describe Hyrax::CitationsBehaviors::Formatters::ChicagoFormatter do
subject(:formatter) { described_class.new(:no_context) }

let(:presenter) { Hyrax::WorkShowPresenter.new(SolrDocument.new(work.to_solr), :no_ability) }
let(:solr_document) do
if work.is_a? ActiveFedora::Base
SolrDocument.new(work.to_solr)
else
SolrDocument.new(GenericWorkIndexer.new(resource: work).to_solr)
end
end
let(:presenter) { Hyrax::WorkShowPresenter.new(solr_document, :no_ability) }
let(:work) { build(:generic_work, title: ['<ScrIPt>prompt("Confirm Password")</sCRIpt>']) }

it 'sanitizes input' do
Expand Down

0 comments on commit d672a40

Please sign in to comment.