hound
hound copied to clipboard
Modular Functionality
I was having an issue trying to split off some common functionality -- would love if someone could help out with an answer
defmodule MyApp.Support.Integration.SignInHelper do
use Hound.Helpers
def sign_in(user) do
navigate_to "/sign_in"
end
end
defmodule MyApp.OtherPageIntegrationTest do
use MyApp.IntegrationCase
import MyApp.Support.Integration.SignInHelper
setup do
user = %{username: "name", password: "password"}
sign_in(user)
{:ok, %{user: user}}
end
test "can view", %{user: user} do
assert visible_page_text() =~ user.username
end
end
What would happen is the SignInHelper.sign_in/1
gets called but then the browser quits.
Seems like the session gets taken away when I use this kind of modular style for writing the tests. Maybe someone can help out?