diff options
Diffstat (limited to 't/tests/sietima/role/manualsubscription.t')
-rw-r--r-- | t/tests/sietima/role/manualsubscription.t | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/t/tests/sietima/role/manualsubscription.t b/t/tests/sietima/role/manualsubscription.t new file mode 100644 index 0000000..f99805d --- /dev/null +++ b/t/tests/sietima/role/manualsubscription.t @@ -0,0 +1,31 @@ +#!perl +use lib 't/lib'; +use Test::Sietima; + +my $s = make_sietima( + with_traits => ['Headers','ManualSubscription'], + name => 'test-list', + owner => 'owner@example.com', + subscribers => [ + 'one@users.example.com', + 'two@users.example.com', + ], +); + +subtest '(un)sub headers should be added' => sub { + test_sending( + sietima => $s, + mails => [ + object { + call sub { +{ shift->header_str_pairs } } => hash { + field 'List-Subscribe' => '<mailto:owner@example.com?subject=Please+add+me+to+test-list>'; + field 'List-Unsubscribe' => '<mailto:owner@example.com?subject=Please+remove+me+from+test-list>'; + + etc; + }; + }, + ], + ); +}; + +done_testing; |