   use BaumeisterWeb.ConnCase
 
   alias BaumeisterWeb.Project
+  alias BaumeisterWeb.ProjectController
+
   @valid_attrs %{name: "some content", plugins: "some content", url: "some content",
     enabled: false, delay: 5}
   @invalid_attrs %{}

  end

  test "updates chosen resource and redirects when data is valid", %{conn: conn} do
    project = Repo.insert! %Project{}
    attributes = unique_attributes()
    conn = put conn, project_path(conn, :update, project), project: attributes
    assert redirected_to(conn) == project_path(conn, :show, project)
    assert Repo.get_by(Project, attributes)

  end

  test "deletes chosen resource", %{conn: conn} do
    # project = Repo.insert! %Project{}
    attributes = unique_attributes()
    {:ok, project} = ProjectController.insert(%Project{name: attributes[:name]})
    conn = delete conn, project_path(conn, :delete, project)
    assert redirected_to(conn) == project_path(conn, :index)
    refute Repo.get(Project, project.id)
