I’m trying to test dynamic data in a controller test but it doesn’t seem to work.
This is my test
test ":show renders the right article", %{conn: conn} do
article = Repo.insert! %Article{}
conn = get conn, article_path(conn, :show, article)
assert html_response(conn, 200) =~ article.title
end
And here is the test failing
** (FunctionClauseError) no function clause matching in Regex.match?/2
It also comes with a long stacktrace which is just the page’s html.
How exactly should I assert article.title?