vendredi 16 février 2018

Testing Phoenix controllers that are in nested folders

I have an elixir umbrella application which contains a phoenix app and an elixir app. The app is working as expected but I am having an issue testing one of the controllers.

The tests in the file will not run when I run the tests. It looks like they are somehow being skipped in the testing process.

The controller file looks something like...

defmodule AppName.File.Path.NameOfController do
  def index(conn, params) do
    render(conn, "index.html")
  end
end

The test file is fairly simple as well and looks something like...

defmodule AppName.File.Path.NameOfControllerTest do
  test "GET /"the_url/I/want", %{conn: conn} do
    conn = get conn, some_path(conn, :index)
    assert html_response(conn, 200) =~ "Some html"
  end
end

All the tests in my project run with the exception on this one file. I thought that it might have something to do with the file path but I cannot see any reason why this would effect the test. I can also go to the endpoint when I run the application.

Any help would be appreciated. Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire