Add some new fixtures in preparation for prune tests.
authorMichael Orlitzky <michael@orlitzky.com>
Wed, 4 Nov 2015 05:18:12 +0000 (00:18 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Wed, 4 Nov 2015 05:18:12 +0000 (00:18 -0500)
test/mailshears_test.rb
test/sql/agendav-fixtures.sql
test/sql/davical-fixtures.sql
test/sql/roundcube-fixtures.sql
test/test_rm.rb

index aea8dfcff8812d0802f55a3edfa16953f0c1b8b1..b4ba814f014e2dd83919f07200ac04dc1804fd18 100644 (file)
@@ -65,33 +65,39 @@ class MailshearsTest < MiniTest::Unit::TestCase
     #
     # 1. agendav_test
     #
     #
     # 1. agendav_test
     #
-    #   +----------------------------+
-    #   |             prefs          |
-    #   +------------------+---------+
-    #   |  username        | options |
-    #   +------------------+---------+
-    #   | adam@example.net | herp    |
-    #   +------------------+---------+
-    #
-    #
-    #   +------------------------------------------------------+
-    #   |                        shared                        |
-    #   +-----+------------------+----------+------------------+
-    #   | sid |    user_from     | calendar |    user_which    |
-    #   +-----+------------------+----------+------------------+
-    #   |   1 | adam@example.net | derp     | beth@example.net |
-    #   +-----+------------------+----------+------------------+
+    #   +------------------------------+
+    #   |              prefs           |
+    #   +--------------------+---------+
+    #   |      username      | options |
+    #   +--------------------+---------+
+    #   |  adam@example.net  | herp    |
+    #   +--------------------+---------+
+    #   | booger@example.com | herp    |
+    #   +------------------  +---------+
+    #
+    #
+    #   +---------------------------------------------------------+
+    #   |                         shared                          |
+    #   +-----+--------------------+----------+-------------------+
+    #   | sid |     user_from      | calendar |    user_which     |
+    #   +-----+--------------------+----------+-------------------+
+    #   |   1 |  adam@example.net  | derp     | beth@example.net  |
+    #   +-----+--------------------+----------+-------------------+
+    #   |   2 | booger@example.com | derp     | carol@example.net |
+    #   +-----+--------------------+----------+-------------------+
     #
     #
     # 2. davical_test
     #
     #
     #
     # 2. davical_test
     #
-    #   +-------------------------------------------------------+
-    #   |                        usr                            |
-    #   +---------+--------+----------------+-------------------+
-    #   | user_no | active |    joined      |     username      |
-    #   +---------+--------+----------------+-------------------+
-    #   |      17 | t      | 2014-01-04 ... | alice@example.com |
-    #   +---------+--------+----------------+-------------------+
+    #   +--------------------------------------------------------+
+    #   |                         usr                            |
+    #   +---------+--------+----------------+--------------------+
+    #   | user_no | active |    joined      |      username      |
+    #   +---------+--------+----------------+--------------------+
+    #   |      17 | t      | 2014-01-04 ... | alice@example.com  |
+    #   +---------+--------+----------------+--------------------+
+    #   |      18 | t      | 2014-01-04 ... | booger@example.com |
+    #   +---------+--------+----------------+--------------------+
     #
     #
     #   +-----------------------------------------+
     #
     #
     #   +-----------------------------------------+
@@ -101,6 +107,8 @@ class MailshearsTest < MiniTest::Unit::TestCase
     #   +---------+--------------+----------------+
     #   |      17 | dumb setting | its dumb value |
     #   +---------+--------------+----------------+
     #   +---------+--------------+----------------+
     #   |      17 | dumb setting | its dumb value |
     #   +---------+--------------+----------------+
+    #   |      18 | dumb setting | its dumb value |
+    #   +---------+--------------+----------------+
     #
     #
     # 3. postfixadmin_test
     #
     #
     # 3. postfixadmin_test
@@ -165,13 +173,15 @@ class MailshearsTest < MiniTest::Unit::TestCase
     # 4. roundcube_test
     #
     #
     # 4. roundcube_test
     #
     #
-    #   +---------+-------------------+
-    #   | user_id |     username      |
-    #   +---------+-------------------+
-    #   |       1 | alice@example.com |
-    #   +---------+-------------------+
-    #   |       2 | adam@example.net  |
-    #   +---------+-------------------+
+    #   +---------+--------------------+
+    #   | user_id |     username       |
+    #   +---------+--------------------+
+    #   |       1 | alice@example.com  |
+    #   +---------+--------------------+
+    #   |       2 | booger@example.com |
+    #   +---------+--------------------+
+    #   |       3 | adam@example.net   |
+    #   +---------+--------------------+
 
     cfg = configuration()
 
 
     cfg = configuration()
 
index 76cdba18ac79add7b19071a8875e96b11dc4f36f..780e062d1c0cb78c7a420b6ba3a6d768e980c63e 100644 (file)
@@ -2,3 +2,8 @@
 INSERT INTO prefs (username, options) VALUES ('adam@example.net', 'herp');
 INSERT INTO shared (user_from, user_which, calendar)
   VALUES ('adam@example.net', 'beth@example.net', 'derp');
 INSERT INTO prefs (username, options) VALUES ('adam@example.net', 'herp');
 INSERT INTO shared (user_from, user_which, calendar)
   VALUES ('adam@example.net', 'beth@example.net', 'derp');
+
+/* Just kidding, here's another one! */
+INSERT INTO prefs (username, options) VALUES ('booger@example.com', 'herp');
+INSERT INTO shared (user_from, user_which, calendar)
+  VALUES ('booger@example.com', 'carol@example.net', 'derp');
index 5abf7a67b2dc5b83b6ea3e45dc4ecf713a1f43d8..8b1f62c9ded5f37a8098888975484bba4869825d 100644 (file)
@@ -14,3 +14,10 @@ INSERT INTO principal_type (principal_type_id, principal_type_desc)
 /* ...and assign it to the new user. */
 INSERT INTO principal (type_id, user_no, displayname, default_privileges)
   VALUES (1, 17, 'Alice', '000000000001111000000000');
 /* ...and assign it to the new user. */
 INSERT INTO principal (type_id, user_no, displayname, default_privileges)
   VALUES (1, 17, 'Alice', '000000000001111000000000');
+
+/* Now here's another user. */
+INSERT INTO usr (user_no, username) VALUES (18, 'booger@example.com');
+INSERT INTO usr_setting (user_no, setting_name, setting_value)
+  VALUES (18, 'dumb setting', 'its dumb value');
+INSERT INTO principal (type_id, user_no, displayname, default_privileges)
+  VALUES (1, 18, 'Booger', '000000000001111000000000');
index 6dc10cb67afa92490f0f73a5c2ae71e52d93f3a4..09653562f274b9726f470ff89eea10ba6d517a51 100644 (file)
@@ -1,3 +1,4 @@
 /* Create records for a subset of the five example.com/net users */
 INSERT INTO users (username) VALUES ('alice@example.com');
 /* Create records for a subset of the five example.com/net users */
 INSERT INTO users (username) VALUES ('alice@example.com');
-INSERT INTO users (username) VALUES ('adam@example.net')
+INSERT INTO users (username) VALUES ('booger@example.com');
+INSERT INTO users (username) VALUES ('adam@example.net');
index f8e046f187f55534a74a2d64c23faaf057e23343..1d424619b76561c054ccd34f86679ab672d19036 100644 (file)
@@ -32,7 +32,7 @@ class TestRm < MailshearsTest
       "DovecotRm - Removed user adam@example.net " +
         "(#{cfg.dovecot_mail_root}/example.net/adam).\n" +
       "PostfixadminRm - Removed user adam@example.net.\n" +
       "DovecotRm - Removed user adam@example.net " +
         "(#{cfg.dovecot_mail_root}/example.net/adam).\n" +
       "PostfixadminRm - Removed user adam@example.net.\n" +
-      "RoundcubeRm - Removed user adam@example.net (User ID: 2).\n"
+      "RoundcubeRm - Removed user adam@example.net (User ID: 3).\n"
 
     assert_equal(expected, actual)
 
 
     assert_equal(expected, actual)
 
@@ -40,12 +40,12 @@ class TestRm < MailshearsTest
 
     arm = AgendavRm.new(cfg)
     actual = arm.list_users()
 
     arm = AgendavRm.new(cfg)
     actual = arm.list_users()
-    expected = []
+    expected = [User.new('booger@example.com')]
     assert_equal(expected, actual)
 
     drm = DavicalRm.new(cfg)
     actual = drm.list_users()
     assert_equal(expected, actual)
 
     drm = DavicalRm.new(cfg)
     actual = drm.list_users()
-    expected = [User.new('alice@example.com')]
+    expected = [User.new('alice@example.com'), User.new('booger@example.com')]
     assert_equal(expected, actual)
 
     pfarm = PostfixadminRm.new(cfg)
     assert_equal(expected, actual)
 
     pfarm = PostfixadminRm.new(cfg)
@@ -73,7 +73,7 @@ class TestRm < MailshearsTest
 
     rrm = RoundcubeRm.new(cfg)
     actual = rrm.list_users()
 
     rrm = RoundcubeRm.new(cfg)
     actual = rrm.list_users()
-    expected = [User.new('alice@example.com')]
+    expected = [User.new('alice@example.com'), User.new('booger@example.com')]
     assert_equal(expected, actual)
 
     # Check that adam's directory is gone but that the rest remain.
     assert_equal(expected, actual)
 
     # Check that adam's directory is gone but that the rest remain.
@@ -110,12 +110,12 @@ class TestRm < MailshearsTest
 
     arm = AgendavRm.new(cfg)
     actual = arm.list_users()
 
     arm = AgendavRm.new(cfg)
     actual = arm.list_users()
-    expected = []
+    expected = [User.new('booger@example.com')]
     assert_equal(expected, actual)
 
     drm = DavicalRm.new(cfg)
     actual = drm.list_users()
     assert_equal(expected, actual)
 
     drm = DavicalRm.new(cfg)
     actual = drm.list_users()
-    expected = [User.new('alice@example.com')]
+    expected = [User.new('alice@example.com'), User.new('booger@example.com')]
     assert_equal(expected, actual)
 
     pfarm = PostfixadminRm.new(cfg)
     assert_equal(expected, actual)
 
     pfarm = PostfixadminRm.new(cfg)
@@ -137,7 +137,7 @@ class TestRm < MailshearsTest
 
     rrm = RoundcubeRm.new(cfg)
     actual = rrm.list_users()
 
     rrm = RoundcubeRm.new(cfg)
     actual = rrm.list_users()
-    expected = [User.new('alice@example.com')]
+    expected = [User.new('alice@example.com'), User.new('booger@example.com')]
     assert_equal(expected, actual)
 
     # Check that example.net's directory is gone but that the rest remain.
     assert_equal(expected, actual)
 
     # Check that example.net's directory is gone but that the rest remain.