                              (generate-commands events)))))
 
                   (testing "> GIS user deleted"
-                    (let [events (conj events user-deleted-event)]
+                    (let [events (conj events gis-user-deleted)]
                       (is (= [{:command/type :db-admin.command/ensure-gis-user-absent
                                :command/time test-time
                                :command/system "territory-bro.db-admin"

                     (generate-commands events)))

              (testing "> GIS user is present"
                (let [events (conj events user-is-present-event)]
                  (is (empty? (generate-commands events)))

                  (testing "> GIS user password changed"
                    (let [events (conj events (assoc user-created-event :gis-user/password "new password"))]
                      (is (= [{:command/type :db-admin.command/ensure-gis-user-present
                               :command/time test-time
                               :command/system "territory-bro.db-admin"

                             (generate-commands events)))

                      (testing "> GIS user is absent"
                        (let [events (conj events gis-user-is-absent)]
                          (is (empty? (generate-commands events))))))))))))))))

(deftest migrate-tenant-schema-test
  (let [spy (spy/spy)
        injections {:now (constantly test-time)
                    :migrate-tenant-schema! (spy/fn spy :migrate-tenant-schema!)}]
    (is (= [gis-schema-is-present]
           (db-admin/handle-command! {:command/type :db-admin.command/migrate-tenant-schema
                                      :command/time test-time
                                      :command/system "test"
