more tests for lists
Chris Nehren [Sun, 4 Sep 2011 05:59:50 +0000 (01:59 -0400)]
t/list.t

index 00a87c9..a398ab9 100644 (file)
--- a/t/list.t
+++ b/t/list.t
@@ -78,6 +78,21 @@ CONFIG
   );
 
   lives_ok { $list->subscribe('foo@example.com') } "can subscribe someone";
+  $list = List->resolve('foo');
+  cmp_deeply(
+    $list->subscribers,
+    {
+      'foo@example.com' => 1,
+    },
+    "subscribing a user adds them to the serialized data",
+  );
+  lives_ok { $list->unsubscribe('foo@example.com') } "can unsubscribe someone";
+  $list = List->resolve('foo');
+  cmp_deeply(
+    $list->subscribers,
+    { },
+    "unsubscribing a user removes them from the serialized data",
+  );
 }
 
 done_testing;