From 9f49c7ceed9906522ae81f5e0443852df7b416e3 Mon Sep 17 00:00:00 2001 From: dakkar Date: Sun, 29 Jan 2017 13:40:19 +0000 Subject: fix SubscriberFromHashRef it made it easy to set prefs, but impossible to set aliases --- t/tests/sietima/role/nomail.t | 4 ++-- t/tests/sietima/role/replyto.t | 4 ++-- t/tests/sietima/role/subscriberonly/drop.t | 12 +++++++++++- 3 files changed, 15 insertions(+), 5 deletions(-) (limited to 't') diff --git a/t/tests/sietima/role/nomail.t b/t/tests/sietima/role/nomail.t index 1622fb4..1ff724c 100644 --- a/t/tests/sietima/role/nomail.t +++ b/t/tests/sietima/role/nomail.t @@ -8,7 +8,7 @@ subtest 'disabled' => sub { subscribers => [ { address => 'one@users.example.com', - wants_mail => 0, + prefs => { wants_mail => 0 }, }, 'two@users.example.com', ], @@ -26,7 +26,7 @@ subtest 'enabled' => sub { subscribers => [ { address => 'one@users.example.com', - wants_mail => 1, + prefs => { wants_mail => 1 }, }, 'two@users.example.com', ], diff --git a/t/tests/sietima/role/replyto.t b/t/tests/sietima/role/replyto.t index bae1bdf..0ede95e 100644 --- a/t/tests/sietima/role/replyto.t +++ b/t/tests/sietima/role/replyto.t @@ -82,7 +82,7 @@ subtest 'enabled for some' => sub { subscribers => [ { address => 'one@users.example.com', - munge_reply_to => 1, + prefs => { munge_reply_to => 1 }, }, 'two@users.example.com', ], @@ -115,7 +115,7 @@ subtest 'disabled for some' => sub { subscribers => [ { address => 'one@users.example.com', - munge_reply_to => 0, + prefs => { munge_reply_to => 0 }, }, 'two@users.example.com', ], diff --git a/t/tests/sietima/role/subscriberonly/drop.t b/t/tests/sietima/role/subscriberonly/drop.t index 6229bb3..77b4b5f 100644 --- a/t/tests/sietima/role/subscriberonly/drop.t +++ b/t/tests/sietima/role/subscriberonly/drop.t @@ -4,7 +4,10 @@ use Test::Sietima; my @subscriber_addresses = ( 'one@users.example.com', - 'two@users.example.com', + { + address => 'two@users.example.com', + aliases => [ 'two-two@users.example.com' ], + }, ); my $s = make_sietima( with_traits => ['SubscriberOnly::Drop'], @@ -18,6 +21,13 @@ subtest 'from subscriber' => sub { ); }; +subtest 'from subscriber alias' => sub { + test_sending( + sietima => $s, + mail => { from=>'two-two@users.example.com' }, + ); +}; + subtest 'from non-subscriber' => sub { test_sending( sietima => $s, -- cgit v1.2.3