mirror of
https://github.com/status-im/open-bounty.git
synced 2025-01-27 17:54:57 +00:00
8aa7c87835
* remove "repo" from required permissions (fixes: #29) * formatting
22 lines
798 B
Clojure
22 lines
798 B
Clojure
(ns commiteth.test.webhooks
|
|
(:require [clojure.test :refer :all]
|
|
[commiteth.routes.webhooks :as webhooks]))
|
|
|
|
|
|
(deftest test-issue-number-extraction
|
|
(testing "Basic fixes case from PR body"
|
|
(let [title "foo"
|
|
body "fixes #123"]
|
|
(is (= '(123) (webhooks/extract-issue-number body title)))))
|
|
(testing "Basic fixes case from PR title"
|
|
(let [title "My title (fixes: #123)"
|
|
body "no use for a body"]
|
|
(is (= '(123) (webhooks/extract-issue-number body title)))))
|
|
(testing "Commented issue number ignored in PR body"
|
|
(let [title "foo"
|
|
body "
|
|
fixes #123
|
|
[comment]: # (To auto-close issue on merge, please insert the related issue number after # i.e fixes #566)
|
|
"]
|
|
(is (= '(123) (webhooks/extract-issue-number body title))))))
|