Skip to content

Instantly share code, notes, and snippets.

@jah2488
Last active August 29, 2015 13:56
Show Gist options
  • Save jah2488/8793357 to your computer and use it in GitHub Desktop.
Save jah2488/8793357 to your computer and use it in GitHub Desktop.
(defn project-link [project]
(when project [:h3 [:a {:href (str "/" (:permaname project) "/project/view")} (str "Project: " (:name project))]]))
(it "returns a link when there is a project in the view context"
(let [project {:project {:name "foo" :permaname "bar"}}
link (nth (project-link project) 1)]
(should link)
(should= "/bar/project/view" (:href (nth link 1)))
(should-contain "Project: foo" link))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment