Commit 2cba923c authored by IKEDA Soji's avatar IKEDA Soji
Browse files

Bug: `quiet` option for `add` request lacked in the test.

parent a6b8d99b
......@@ -8,6 +8,7 @@ use English qw(-no_match_vars);
use File::Temp qw();
use Test::More;
use Sympa::ConfDef;
use Sympa::DatabaseManager;
use Sympa::List;
use Sympa::Log;
......@@ -34,7 +35,16 @@ my $tempdir = File::Temp->newdir(CLEANUP => ($ENV{TEST_DEBUG} ? 0 : 1));
queuesubscribe => $tempdir . '/auth',
bounce_path => $tempdir . '/bounce',
etc => $tempdir . '/etc',
allow_subscribe_if_pending => 'off',
);
# Apply defaults.
foreach my $pinfo (grep { $_->{name} and exists $_->{default} }
@Sympa::ConfDef::params) {
$Conf::Conf{$pinfo->{name}} = $pinfo->{default}
unless exists $Conf::Conf{$pinfo->{name}};
}
mkdir $Conf::Conf{queuesubscribe};
mkdir $Conf::Conf{bounce_path};
mkdir $Conf::Conf{bounce_path} . '/' . $listname . '@' . $Conf::Conf{domain};
......@@ -130,6 +140,7 @@ do_test(
action => 'add',
email => $member1->[0],
gecos => $member1->[1],
quiet => 1,
},
data => [$member1],
name => 'add subscriber'
......@@ -150,6 +161,7 @@ do_test(
action => 'add',
email => $member2->[0],
gecos => $member2->[1],
quiet => 1,
},
data => [$member1, $member2],
name => 'add subscriber: Not exceeding max_list_members'
......@@ -171,6 +183,7 @@ do_test(
role => 'owner',
email => $owner1->[1],
gecos => $owner1->[2],
quiet => 1,
},
data => [$owner1],
name => 'add owner'
......@@ -181,6 +194,7 @@ do_test(
role => 'editor',
email => $editor1->[1],
gecos => $editor1->[2],
quiet => 1,
},
data => [$editor1, $owner1],
name => 'add moderator'
......@@ -201,6 +215,7 @@ do_test(
role => 'editor',
email => [map { $_->[1] } ($editor1, $editor2, $editor3)],
gecos => [map { $_->[2] } ($editor1, $editor2, $editor3)],
quiet => 1,
},
result => [[qw(user already_user)], [qw(notice add_performed)]],
data => [$editor1, $editor2, $editor3, $owner1],
......@@ -220,6 +235,7 @@ do_test(
request => {
action => 'del',
email => $member1->[0],
quiet => 1,
},
data => [$member2],
name => 'del subscriber'
......@@ -228,6 +244,7 @@ do_test(
request => {
action => 'del',
email => [$member1->[0], $member2->[0]],
quiet => 1,
},
data => [],
result => [[qw(user user_not_subscriber)], [qw(notice removed)]],
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment