 
     conn = post conn, session_path(conn, :create), user: @valid_attrs
     assert redirected_to(conn) == "/"
-    assert get_session(conn, :user_id) == user.id
+    conn = get conn, "/"
+    assert html_response(conn, 200) =~ user.email
   end
 
   test "login fails if email is invalid", %{conn: conn} do


    conn = post conn, session_path(conn, :create), user: %{email: "ooh@rigby.com", password: user.password}
    assert html_response(conn, 200) =~ "Email or password incorrect"
    assert get_session(conn, :user_id) == nil
  end

  test "login fails if password is invalid", %{conn: conn} do


    conn = post conn, session_path(conn, :create), user: %{email: user.email, password: "please"}
    assert html_response(conn, 200) =~ "Email or password incorrect"
  end

end
