Sha256: 9b1a354b89a0cb843b7e5a30f146db633cd07effbc7fd87e381b5bf29a7d70b7

Contents?: true

Size: 920 Bytes

Versions: 27

Compression:

Stored size: 920 Bytes

Contents

require 'spec_helper'

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

27 entries across 27 versions & 1 rubygems

Version Path
blacklight-spotlight-0.18.0 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-0.17.1 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-0.17.0 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-0.16.0 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-0.15.0 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-0.14.2 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-0.14.1 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-0.14.0 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-0.13.0 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-0.12.1 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-0.12.0 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-0.11.0 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-0.10.3 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-0.10.2 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-0.10.1 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-0.10.0 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-0.9.2 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-0.9.1 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-0.9.0 spec/mailers/spotlight/indexing_complete_mailer_spec.rb
blacklight-spotlight-0.8.2 spec/mailers/spotlight/indexing_complete_mailer_spec.rb