     refute_delivered_email Sentinel.Mailer.NewEmailAddress.build(user, "token")
     assert String.contains?(conn.private.phoenix_flash["info"], "Signed up")
     assert String.contains?(conn.resp_body, Sentinel.Config.router_helper.account_path(Sentinel.Config.endpoint, :edit))
+    assert Guardian.Plug.current_resource(conn).id == user.id
   end
 
   test "inviting a user via the invitable sign up", %{conn: conn, invite_params: params, invite_email: mocked_mail} do # green

      assert_delivered_email mocked_mail
      assert String.contains?(conn.private.phoenix_flash["info"], "You will receive an email with instructions for how to confirm your email address in a few minutes.")
      assert String.contains?(conn.resp_body, Sentinel.Config.router_helper.account_path(Sentinel.Config.endpoint, :edit))
    end
  end


      refute is_nil(user.hashed_confirmation_token)
      assert_delivered_email mocked_mail
      assert String.contains?(conn.private.phoenix_flash["info"], "You must confirm your account to continue. You will receive an email with instructions for how to confirm your email address in a few minutes.")
      assert Guardian.Plug.current_resource(conn) == nil
    end
  end

