Sha256: b30b7ae5d66a9ae172b23fa5abb7b025f7073f3e97e4592ffbf7d9a628744119

Contents?: true

Size: 898 Bytes

Versions: 48

Compression:

Stored size: 898 Bytes

Contents

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

48 entries across 48 versions & 1 rubygems

Version Path
blacklight-spotlight-2.0.2 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-2.0.1 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-2.0.0 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-2.0.0.rc6 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-2.0.0.rc5 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-2.0.0.rc4 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-2.0.0.rc3 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-2.0.0.rc2 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-2.0.0.rc1 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-1.5.1 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-1.4.1 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-1.4.0 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-1.3.0 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-1.2.0 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-1.1.0 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-1.0.0 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-1.0.0.alpha2 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-1.0.0.alpha1 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-0.34.1 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-0.34.0 spec/mailers/spotlight/indexing_complete_mailer_spec.rb