This commit is contained in:
2024-09-11 22:41:17 -03:00
parent 3cefdd8f38
commit 2dd0587393
17 changed files with 131 additions and 38 deletions

View File

@ -0,0 +1,13 @@
require "test_helper"
class RutaControllerTest < ActionDispatch::IntegrationTest
test "should get get" do
get ruta_get_url, params: {ruta: 1}
assert_response :success
end
test "should get add" do
post ruta_add_url, params: {viajes: [{direccion_partida: "Partida", direccion_llegada: "Llegada", kms: 10, entregas: [{nombre_recibe: "Recibe", carga: "{\"cantidad\": 10, \"descripcion\": \"Cajas\"}"}], retiros: [{nombre_entrega: "Entrega", carga: "{\"cantidad\": 2, \"descripcion\": \"Cajas\"}"}]}]}
assert_response :success
end
end

View File

@ -4,4 +4,12 @@ class RutaTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
test "create" do
assert Ruta.create
end
test "get" do
ruta = Ruta.find(1)
assert Ruta.id === 1
end
end