Sha256: bb315175904ceaea455c2dede8054fee7cdafeee76267ea518beb2fbc3dc41af
Contents?: true
Size: 935 Bytes
Versions: 23
Compression:
Stored size: 935 Bytes
Contents
describe Spotlight::ReindexJob do let(:exhibit) { FactoryGirl.create(:exhibit) } let(:resource) { FactoryGirl.create(:resource) } before do allow_any_instance_of(Spotlight::Resource).to receive(:reindex) end context 'with an exhibit' do subject { described_class.new(exhibit) } before do exhibit.resources << resource exhibit.save end it 'attempts to reindex every resource in the exhibit' do # ActiveJob will reload the collection, so we go through a little trouble: expect_any_instance_of(Spotlight::Resource).to receive(:reindex) do |thingy| expect(exhibit.resources).to include thingy end subject.perform_now end end context 'with a resource' do subject { described_class.new(resource) } it 'attempts to reindex every resource in the exhibit' do expect(resource).to receive(:reindex) subject.perform_now end end end
Version data entries
23 entries across 23 versions & 1 rubygems