Teemu Patja 8aa7c87835
Remove "repo" oauth scope
* remove "repo" from required permissions (fixes: #29)
* formatting
2017-03-08 22:06:15 +02:00

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))))))