Skip to content

Instantly share code, notes, and snippets.

@trestrantham
Last active August 29, 2015 14:15
Show Gist options
  • Save trestrantham/c9abeec38e4f86154f65 to your computer and use it in GitHub Desktop.
Save trestrantham/c9abeec38e4f86154f65 to your computer and use it in GitHub Desktop.
Phoenix integration testing
defmodule IntegrationTest do
use ExUnit.Case
use TucoTuco.DSL
setup_all do
{:ok, _} = TucoTuco.start_session :test_browser, :test_session, :phantomjs
host = Integration.Endpoint.config(:url)[:host]
port = Integration.Endpoint.config(:http)[:port]
TucoTuco.app_root "http://#{host}:#{port}"
on_exit fn ->
TucoTuco.stop
end
end
test "the truth" do
visit TucoTuco.app_root
assert current_url == "http://localhost:4001/"
assert Page.has_text? "Phoenix"
end
end
@trestrantham
Copy link
Author

Must add server: true to config/text.exs endpoint configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment