require 'spec_helper' describe Krikri::QAReport do subject { described_class.new(provider) } let(:provider) do agent = build(:agent) agent.set_subject! 'http://example.org/moomin' agent end let(:solutions) do RDF::Query::Solutions.new( [RDF::Query::Solution.new(value: RDF::Literal('abc'), aggregation: DPLA::MAP::Aggregation .new('too-ticki'), isShownAt: DPLA::MAP::WebResource .new('http://example.org/too-ticki')), RDF::Query::Solution.new(value: RDF::Literal('abc'), aggregation: DPLA::MAP::Aggregation .new('little-my'), isShownAt: DPLA::MAP::WebResource .new('http://example.org/little-my')), RDF::Query::Solution.new(value: RDF::Literal('123'), aggregation: DPLA::MAP::Aggregation .new('moomin-mama'), isShownAt: DPLA::MAP::WebResource .new('http://example.org/moomin-mama'))]) end describe '#provider' do it 'is set on initalization' do expect(subject.provider).to eq provider end end describe '#generate' do before do agg = build(:aggregation) agg.set_subject!('mummi123') agg.provider = provider agg.save agg2 = build(:aggregation) agg2.set_subject!('mummi223') agg2.provider = provider agg2.save end it do require 'pry' binding.pry end it 'populates report with hash' it 'generates data for all fields' end describe '#solutions_to_hash' do it '' do subject.send(:solutions_to_hash, solutions) end end end