webspicy 0.20.12 → 0.20.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/webspicy/tester/fakesendgrid/email.rb +3 -1
- data/lib/webspicy/tester/fakeses/email.rb +6 -3
- data/lib/webspicy/version.rb +1 -1
- data/spec/unit/tester/fakesendgrid/test_email.rb +1 -1
- data/spec/unit/tester/fakeses/test_email.rb +21 -4
- data/spec/unit/tester/fakesmtp/test_email.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01b2fecc83c9d660dc6eba242b306e965196a6ecf9ad12b9b0e5929d9394e1ab
|
4
|
+
data.tar.gz: 16e008749db41f89755e9c0cc65457e438383044aaf54c6e171fc565b2da8ba0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f7a18cbbfead965fefc954c07ea8ebb2d91e60cfd0e72c2658ec5e7c5c1425b6d9f0c8e2d3c09e7b3399697ab299c36f9873e1837422f785e96e1a298cccfaa
|
7
|
+
data.tar.gz: 12377e4af44a7b6d65c6daf3c83a41d1201ec3deab8922343b25f8f6483f07fb997dca45ed6e3fbc243c5f869c915642a7e6a867bf90dc0e5f8bae5fda7fb726
|
@@ -9,7 +9,10 @@ module Webspicy
|
|
9
9
|
attr_reader :data
|
10
10
|
|
11
11
|
def from
|
12
|
-
|
12
|
+
rx = /^From:\s*(.*)$/
|
13
|
+
raw_data
|
14
|
+
.each_line
|
15
|
+
.find{|l| l =~ rx }[rx, 1].strip
|
13
16
|
end
|
14
17
|
|
15
18
|
def to
|
@@ -18,14 +21,14 @@ module Webspicy
|
|
18
21
|
.select{|(k,v)|
|
19
22
|
k =~ /Destinations.member/
|
20
23
|
}
|
21
|
-
.map{|(k,v)| v }
|
24
|
+
.map{|(k,v)| v.strip }
|
22
25
|
end
|
23
26
|
|
24
27
|
def subject
|
25
28
|
rx = /^Subject:\s*(.*)$/
|
26
29
|
raw_data
|
27
30
|
.each_line
|
28
|
-
.find{|l| l =~ rx }[rx, 1]
|
31
|
+
.find{|l| l =~ rx }[rx, 1].strip
|
29
32
|
end
|
30
33
|
|
31
34
|
def raw_data
|
data/lib/webspicy/version.rb
CHANGED
@@ -40,7 +40,7 @@ module Webspicy
|
|
40
40
|
}
|
41
41
|
|
42
42
|
it 'works as expected' do
|
43
|
-
expect(subject.from).to eql("info@mydomain.be")
|
43
|
+
expect(subject.from).to eql("Foo Bar <info@mydomain.be>")
|
44
44
|
expect(subject.to).to eql(["support@mydomain.fr"])
|
45
45
|
expect(subject.subject).to eql("Hello World")
|
46
46
|
end
|
@@ -6,9 +6,26 @@ module Webspicy
|
|
6
6
|
describe Email do
|
7
7
|
|
8
8
|
DATA = Base64.encode64 <<~J
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
Content-Type: multipart/alternative;
|
10
|
+
boundary="--_NmP-d246fd025a6652c9-Part_1"
|
11
|
+
From: Webspicy <noreply@webspicy.io>
|
12
|
+
To: david.parloir@gmail.com
|
13
|
+
Subject: Hey world, hello!
|
14
|
+
Message-ID: <2421bae3-9c42-7988-23b4-b1f6168130c9@webspicy.io>
|
15
|
+
Date: Thu, 24 Jun 2021 13:45:16 +0000
|
16
|
+
MIME-Version: 1.0
|
17
|
+
|
18
|
+
----_NmP-d246fd025a6652c9-Part_1
|
19
|
+
Content-Type: text/plain; charset=utf-8
|
20
|
+
Content-Transfer-Encoding: 7bit
|
21
|
+
|
22
|
+
Hello world, in a text version
|
23
|
+
----_NmP-d246fd025a6652c9-Part_1
|
24
|
+
Content-Type: text/html; charset=utf-8
|
25
|
+
Content-Transfer-Encoding: 7bit
|
26
|
+
|
27
|
+
Hello world, in an html version
|
28
|
+
----_NmP-d246fd025a6652c9-Part_1--
|
12
29
|
J
|
13
30
|
|
14
31
|
DATA = JSON.parse <<~J
|
@@ -29,7 +46,7 @@ module Webspicy
|
|
29
46
|
}
|
30
47
|
|
31
48
|
it 'works as expected' do
|
32
|
-
expect(subject.from).to eql("noreply@webspicy.io")
|
49
|
+
expect(subject.from).to eql("Webspicy <noreply@webspicy.io>")
|
33
50
|
expect(subject.to).to eql(["someone@world.com"])
|
34
51
|
expect(subject.subject).to eql("Hey world, hello!")
|
35
52
|
end
|
@@ -15,7 +15,7 @@ module Webspicy
|
|
15
15
|
},
|
16
16
|
{
|
17
17
|
"key": "from",
|
18
|
-
"line": "From:
|
18
|
+
"line": "From: Webspicy <noreply@webspicy.io>"
|
19
19
|
},
|
20
20
|
{
|
21
21
|
"key": "reply-to",
|
@@ -82,7 +82,7 @@ module Webspicy
|
|
82
82
|
}
|
83
83
|
|
84
84
|
it 'works as expected' do
|
85
|
-
expect(subject.from).to eql("
|
85
|
+
expect(subject.from).to eql("Webspicy <noreply@webspicy.io>")
|
86
86
|
expect(subject.to).to eql(["support@mydomain.fr"])
|
87
87
|
expect(subject.subject).to eql("Hello World")
|
88
88
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webspicy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.20.
|
4
|
+
version: 0.20.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bernard Lambeau
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-06-
|
11
|
+
date: 2021-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|