Sha256: 42c5a1c8dd7708f0781941b637ed8bb18878f8318bc506b77be06cf9c9049ece
Contents?: true
Size: 783 Bytes
Versions: 30
Compression:
Stored size: 783 Bytes
Contents
describe Spotlight::RenameSidecarFieldJob do let(:exhibit) { FactoryGirl.create(:exhibit) } let(:sidecar) { SolrDocument.new(id: 'test').sidecar(exhibit).tap(&:save!) } it 'updates the sidecar data and reindex affected documents' do expect_any_instance_of(::SolrDocument).to receive(:reindex) sidecar.data['old_field'] = 'some value' sidecar.save! described_class.perform_later(exhibit, 'old_field', 'new_field') sidecar.reload expect(sidecar.data['new_field']).to eq 'some value' end it 'does not touch unaffected documents' do expect_any_instance_of(::SolrDocument).not_to receive(:reindex) sidecar.data['other_field'] = 'some value' sidecar.save! described_class.perform_later(exhibit, 'old_field', 'new_field') end end
Version data entries
30 entries across 30 versions & 1 rubygems