aboutsummaryrefslogtreecommitdiff
path: root/t/tests/sietima/role/manualsubscription.t
blob: f99805df9dde23c2cc939a431c14655c3cab17d8 (plain)
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
#!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;