File: common_message_id_spec.rb

package info (click to toggle)
ruby-mail 2.6.4%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,256 kB
  • ctags: 1,327
  • sloc: ruby: 44,678; makefile: 3
file content (31 lines) | stat: -rw-r--r-- 1,059 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# frozen_string_literal: true
require 'spec_helper'
require 'mail/fields/common/common_message_id'

describe Mail::CommonMessageId do
  
  describe "encoding and decoding fields" do
    
    it "should allow us to encode a message id field" do
      field = Mail::MessageIdField.new('<ThisIsANonUniqueMessageId@me.com>')
      expect(field.encoded).to eq "Message-ID: <ThisIsANonUniqueMessageId@me.com>\r\n"
    end
    
    it "should allow us to encode a message id field" do
      field = Mail::MessageIdField.new('<1234@test.lindsaar.net>')
      expect(field.encoded).to eq "Message-ID: <1234@test.lindsaar.net>\r\n"
    end
    
    it "should allow us to encode an in reply to field" do
      field = Mail::InReplyToField.new('<1234@test.lindsaar.net>')
      expect(field.encoded).to eq "In-Reply-To: <1234@test.lindsaar.net>\r\n"
    end

    it "should allow us to decode a message id field" do
      field = Mail::MessageIdField.new('<1234@test.lindsaar.net>')
      expect(field.decoded).to eq "<1234@test.lindsaar.net>"
    end
    
  end
  
end