I am trying to create a range selector, and it seems I cannot get off the ground.
I try things like:
(sniptest "<div><p class='start'>Hi</p><p class='end'>There</p></div>"
[{[:.start] [:.end]}] (content "Hello"))
And that just returns the supplied html. I expect it to return a div with the body Hello.
How to do it?
EDIT
To be more concise, this is what I did with the deftemplate and the real html file:
HTML
<html>
<head>
<title></title>
</head>
<body>
<h1>Not hello</h1>
<div class="start">
foo
</div>
<div class="end">
bar
</div>
</body>
</html>
CLJ
(ns compojure-blog-test.views.landing-page
(:require [net.cgrand.enlive-html :as html]))
(html/deftemplate landing-page "compojure_blog_test/views/landing_page.html"
[blogs]
{[:.start] [:.end]} (html/content "Blah blah"))
I follow this tutorial , but it uses a fragment to match ranges. It's not obligatory?
Is it possible to test them only with sniptest?
source
share