Sha256: 5a2a32e2f8dfb3e89bfa46a74e348a1ecf4ff1a49b05dfd5fae0ab31d21e0d26

Contents?: true

Size: 928 Bytes

Versions: 18

Compression:

Stored size: 928 Bytes

Contents

# frozen_string_literal: true

describe Spotlight::IndexingCompleteMailer do
  let(:user) { double(email: 'test@example.com') }
  let(:exhibit) { double(title: 'Exhibit title') }
  subject { described_class.documents_indexed [1, 2, 3], exhibit, user }

  it 'renders the receiver email' do
    expect(subject.to).to eql([user.email])
  end

  it 'includes a title' do
    expect(subject.body.encoded).to match 'Your CSV file has just finished being processed'
  end

  it 'describes how many documents were indexed' do
    expect(subject.body.encoded).to match '3 documents'
  end

  context 'single item' do
    subject { described_class.documents_indexed [1], exhibit, user }

    it 'handles pluralization when only a single item was indexed' do
      expect(subject.body.encoded).to match '1 document has'
    end
  end

  it 'includes the exhibit title' do
    expect(subject.body.encoded).to match exhibit.title
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
blacklight-spotlight-3.0.0.alpha.2 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-3.0.0.alpha.1 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-2.13.0 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-2.12.1 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-2.12.0 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-2.11.0 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-2.10.0 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-2.9.0 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-2.8.0 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-2.7.2 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-2.7.1 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-2.7.0 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-2.6.1.1 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-2.6.1 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-2.6.0 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-2.5.2 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-2.5.1 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-2.5.0 spec/mailers/spotlight/indexing_complete_mailer_spec.rb