Last active
August 29, 2015 14:15
-
-
Save trestrantham/c9abeec38e4f86154f65 to your computer and use it in GitHub Desktop.
Phoenix integration testing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Must add
server: true
toconfig/text.exs
endpoint configuration.