     end
   end
 
-  @tag :skip
-  test "creates and renders resource when data is valid", %{conn: conn} do
-    conn = post conn, transaction_path(conn, :create), transaction: @valid_attrs
+  test "creates and renders resource when data is valid", %{conn: conn, attributes: attributes} do
+    conn = post conn, transaction_path(conn, :create), transaction: attributes
     assert json_response(conn, 201)["data"]["id"]
-    assert Repo.get_by(Transaction, @valid_attrs)
+    assert Repo.get_by(Transaction, attributes)
   end
 
   test "does not create resource and renders errors when data is invalid", %{conn: conn} do

      name: Faker.Lorem.sentence(%Range{first: 1, last: 10}),
      type: Enum.random(BalanceSheet.Enumerations.AccountType.__valid_values__())
    }))

    {:ok, conn: new_conn, account: account}
  end

  test "lists all entries on index", context do

    assert json_response(conn, 422)["errors"] != %{}
  end

  test "updates and renders chosen resource when data is valid", %{conn: conn, attributes: attributes} do
    transaction = Repo.insert!(struct(Transaction, attributes))
    conn = put conn, transaction_path(conn, :update, transaction), transaction: attributes
    assert json_response(conn, 200)["data"]["id"]
    assert Repo.get_by(Transaction, attributes)
  end

  test "does not update chosen resource and renders errors when data is invalid", %{conn: conn, attributes: attributes} do
    transaction = Repo.insert!(struct(Transaction, attributes))
    conn = put conn, transaction_path(conn, :update, transaction), transaction: @invalid_attrs
    assert json_response(conn, 422)["errors"] != %{}
  end

  test "deletes chosen resource", %{conn: conn, attributes: attributes} do
    transaction = Repo.insert!(struct(Transaction, attributes))
    conn = delete conn, transaction_path(conn, :delete, transaction)
    assert response(conn, 204)
    refute Repo.get(Transaction, transaction.id)
