Fix Postfixadmin alias updating (don't leave commas at the start/end).
[mailshears.git] / test / test_prune.rb
index d32fcae00958adc124e4f20885bdfa6bb22e5765..35c1a5c6941d391c008807df8d79fc392ff76183 100644 (file)
@@ -56,17 +56,21 @@ class TestPrune < MailshearsTest
     assert_equal(expected, actual)
 
     actual = pfapr.list_aliases()
-    expected = [{'address' => 'alice@example.com',
-                    'goto' => 'alice@example.com'},
-                {'address' => 'bob@example.com',
-                    'goto' => 'bob@example.com'},
-                {'address' => 'adam@example.net',
-                    'goto' => 'adam@example.net'},
+    expected = [{'address' => 'adam@example.net',
+                 'goto' => 'adam@example.net'},
+                {'address' => 'alice@example.com',
+                 'goto' => 'alice@example.com,' +
+                           'adam@example.net,' +
+                           'bob@example.com,' +
+                           'carol@example.net'},
                 {'address' => 'beth@example.net',
-                    'goto' => 'beth@example.net'},
+                 'goto' => 'beth@example.net'},
+                {'address' => 'bob@example.com',
+                 'goto' => 'bob@example.com'},
                 {'address' => 'carol@example.net',
-                    'goto' => 'carol@example.net'}]
-    assert_equal(expected, actual)
+                 'goto' => 'carol@example.net'}]
+    expected.each { |e| assert(actual.include?(e)) } # can't sort dicts
+    actual.each { |a| assert(expected.include?(a)) } # can't sort dicts
 
     rpr = RoundcubePrune.new(cfg)
     actual = rpr.list_users()