Sha256: 5f9b6958854eb8809418c7a36dfd4a34d5f6adc3f2f30897fcef524c8a3c625b

Contents?: true

Size: 991 Bytes

Versions: 37

Compression:

Stored size: 991 Bytes

Contents

require 'rails_helper'

describe "CamaleonCms::HtmlMailer" do
  describe 'empty content' do
    get_current_test_site()
    let(:mail) { CamaleonCms::HtmlMailer.sender('test@gmail.com', "test") }

    it 'renders the subject' do
      expect(mail.subject).to eql('test')
    end

    it 'renders the receiver email' do
      expect(mail.to).to eql(['test@gmail.com'])
    end

    it 'renders the sender email' do
      expect(mail.from).to eql(['owenperedo@gmail.com'])
    end

    it 'html layout text' do
      expect(mail.body.encoded).to match('Visit Site')
    end
  end

  describe 'custom content' do
    get_current_test_site()
    let(:mail) { CamaleonCms::HtmlMailer.sender('test@gmail.com', "test", content: 'custom content', cc_to: ['a@gmail.com', 'b@gmail.com']) }

    it 'renders the sender email' do
      expect(mail.cc).to eql(['a@gmail.com', 'b@gmail.com'])
    end

    it 'custom content' do
      expect(mail.body.encoded).to match('custom content')
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
camaleon_cms-2.4.5.5 spec/mailers/send_mail_spec.rb
camaleon_cms-2.4.5.4 spec/mailers/send_mail_spec.rb
camaleon_cms-2.4.5.3 spec/mailers/send_mail_spec.rb
camaleon_cms-2.4.5.2 spec/mailers/send_mail_spec.rb
camaleon_cms-2.4.5.1 spec/mailers/send_mail_spec.rb
camaleon_cms-2.4.5 spec/mailers/send_mail_spec.rb
camaleon_cms-2.4.4.7 spec/mailers/send_mail_spec.rb
camaleon_cms-2.4.4.6 spec/mailers/send_mail_spec.rb
camaleon_cms-2.4.4.5 spec/mailers/send_mail_spec.rb
camaleon_cms-2.4.4.4 spec/mailers/send_mail_spec.rb
camaleon_cms-2.4.4.3 spec/mailers/send_mail_spec.rb
camaleon_cms-2.4.4.2 spec/mailers/send_mail_spec.rb
camaleon_cms-2.4.4.1 spec/mailers/send_mail_spec.rb
camaleon_cms-2.4.4 spec/mailers/send_mail_spec.rb
camaleon_cms-2.4.3.13 spec/mailers/send_mail_spec.rb
camaleon_cms-2.4.3.12 spec/mailers/send_mail_spec.rb
camaleon_cms-2.4.3.11 spec/mailers/send_mail_spec.rb
camaleon_cms-2.4.3.10 spec/mailers/send_mail_spec.rb
camaleon_cms-2.4.3.9 spec/mailers/send_mail_spec.rb
camaleon_cms-2.4.3.8 spec/mailers/send_mail_spec.rb