diff --git a/test/clj/auto_ap/ssr/admin/transaction_rules_test.clj b/test/clj/auto_ap/ssr/admin/transaction_rules_test.clj index f5e66eb3..df0dd3c2 100644 --- a/test/clj/auto_ap/ssr/admin/transaction_rules_test.clj +++ b/test/clj/auto_ap/ssr/admin/transaction_rules_test.clj @@ -183,6 +183,31 @@ (is (= 200 (:status response))) (is (string? (apply str (:body response)))))))) +(deftest execute-dialog-route-works + (testing "Execute dialog route should return execution dialog" + ;; Given: Create a transaction rule + (let [tempids (setup-test-data [{:db/id "rule-to-execute" + :transaction-rule/description "Rule to Execute" + :transaction-rule/note "Execute me"}]) + rule-id (get tempids "rule-to-execute") + request {:identity (admin-token) + :route-params {:db/id rule-id}}] + ;; When: Call execute-dialog route + (let [response ((get sut/key->handler :auto-ap.routes.admin.transaction-rules/execute-dialog) request)] + ;; Then: Returns HTML dialog + (is (= 200 (:status response))) + (is (string? (apply str (:body response)))))))) + +(deftest new-dialog-route-returns-empty-form + (testing "New dialog route should return empty form for new rule" + ;; Given: Admin request + (let [request {:identity (admin-token)}] + ;; When: Call new-dialog route + (let [response ((get sut/key->handler :auto-ap.routes.admin.transaction-rules/new-dialog) request)] + ;; Then: Returns HTML form + (is (= 200 (:status response))) + (is (string? (apply str (:body response)))))))) + ;; ============================================ ;; Phase 5: CRUD and Security Tests ;; ============================================