     body = Poison.decode!(conn.resp_body)
 
     assert length(body) == 0
-
-    :meck.new(Repo)
   end
-
 end

    assert length(body) == 2

    assert Enum.any?(body, &(&1["id"] == 1))
    assert Enum.any?(body, &(&1["id"] == 2))
    assert Enum.any?(body, &(&1["name"] == "aws"))
    assert Enum.any?(body, &(&1["name"] == "azure"))
    assert Enum.any?(body, &(&1["type"] == "aws"))


    {_, location} = List.keyfind(conn.resp_headers, "location", 0)

    assert Regex.match?(~r/\/cloud_providers\/\d+/, location)
  end

  test "update action -- not found" do
    conn = call(Router, :put, "/cloud_providers/1", Poison.encode!(%{name: "azure", type: "azure", configuration: "{some_config}"}), [{"content-type", "application/json"}])

    assert conn.status == 404
  end

  test "update action -- fails on invalid change" do
    provider = CloudProvider.new(%{name: "aws", type: "aws", configuration: "{}"}) |> Repo.insert

    conn = call(Router, :put, "/cloud_providers/#{provider.id}", Poison.encode!(%{name: "", type: "", configuration: ""}), [{"content-type", "application/json"}])

    assert conn.status == 400

