Sha256: 90fc61f7108ed31c3bbbba5f3bcf63f038404728326a5bfea2ff7ce3baf32793

Contents?: true

Size: 887 Bytes

Versions: 6

Compression:

Stored size: 887 Bytes

Contents

# -*- encoding : utf-8 -*-

describe Card::Set::Type::EmailTemplate do
  describe "#mail" do
    let(:content_type) do
      Card::Auth.signin Card::WagnBotID
      card = Card.create!(name: "content type test", type: :email_template,
                          subcards: @fields)

      email = card.format.mail
      email[:content_type].value
    end

    it "renders text email if text message given" do
      @fields = { "+*text_message" => "text" }
      expect(content_type).to include "text/plain"
    end

    it "renders html email if html message given" do
      @fields = { "+*html_message" => "text" }
      expect(content_type).to include "text/html"
    end

    it "renders multipart email if text and html given" do
      @fields = { "+*text_message" => "text", "+*html_message" => "text" }
      expect(content_type).to include "multipart/alternative"
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
card-1.100.0 mod/standard/spec/set/type/email_template_spec.rb
card-1.99.6 mod/standard/spec/set/type/email_template_spec.rb
card-1.99.5 mod/standard/spec/set/type/email_template_spec.rb
card-1.99.4 mod/standard/spec/set/type/email_template_spec.rb
card-1.99.3 mod/standard/spec/set/type/email_template_spec.rb
card-1.99.2 mod/standard/spec/set/type/email_template_spec.rb