Added vehicle scaffold
Some checks are pending
CI / scan_ruby (push) Waiting to run
CI / scan_js (push) Waiting to run
CI / lint (push) Waiting to run
CI / test (push) Waiting to run

This commit is contained in:
2024-08-20 19:50:29 +02:00
parent 1bd24e08d0
commit 132ea2c51d
20 changed files with 379 additions and 1 deletions

View File

@@ -0,0 +1,48 @@
require "test_helper"
class VehiclesControllerTest < ActionDispatch::IntegrationTest
setup do
@vehicle = vehicles(:one)
end
test "should get index" do
get vehicles_url
assert_response :success
end
test "should get new" do
get new_vehicle_url
assert_response :success
end
test "should create vehicle" do
assert_difference("Vehicle.count") do
post vehicles_url, params: { vehicle: { car_brand: @vehicle.car_brand, fuel_type: @vehicle.fuel_type, license_plate: @vehicle.license_plate, model: @vehicle.model, model_year: @vehicle.model_year, type: @vehicle.type } }
end
assert_redirected_to vehicle_url(Vehicle.last)
end
test "should show vehicle" do
get vehicle_url(@vehicle)
assert_response :success
end
test "should get edit" do
get edit_vehicle_url(@vehicle)
assert_response :success
end
test "should update vehicle" do
patch vehicle_url(@vehicle), params: { vehicle: { car_brand: @vehicle.car_brand, fuel_type: @vehicle.fuel_type, license_plate: @vehicle.license_plate, model: @vehicle.model, model_year: @vehicle.model_year, type: @vehicle.type } }
assert_redirected_to vehicle_url(@vehicle)
end
test "should destroy vehicle" do
assert_difference("Vehicle.count", -1) do
delete vehicle_url(@vehicle)
end
assert_redirected_to vehicles_url
end
end