Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modular Functionality #178

Open
sitch opened this issue Aug 24, 2017 · 0 comments
Open

Modular Functionality #178

sitch opened this issue Aug 24, 2017 · 0 comments

Comments

@sitch
Copy link

sitch commented Aug 24, 2017

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant