aboutsummaryrefslogtreecommitdiff
path: root/t/tests/sietima/role/nomail.t
blob: a0be192310b9194d4b6f81b7c65b4fb47b303e79 (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
32
33
34
35
36
37
38
39
40
41
42
43
44
#!perl 
use strict;
use warnings;
use 5.024;
use lib 't/lib';
use Test::Sietima;
 
subtest 'disabled' => sub {
    my $s = make_sietima(
        with_traits => ['NoMail'],
        subscribers => [
            {
                address => 'one@users.example.com',
                wants_mail => 0,
            },
            'two@users.example.com',
        ],
    );
 
    test_sending(
        sietima => $s,
        to => ['two@users.example.com'],
    );
};
 
subtest 'enabled' => sub {
    my $s = make_sietima(
        with_traits => ['NoMail'],
        subscribers => [
            {
                address => 'one@users.example.com',
                wants_mail => 1,
            },
            'two@users.example.com',
        ],
    );
 
    test_sending(
        sietima => $s,
        to => ['one@users.example.com','two@users.example.com'],
    );
};
 
done_testing;