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,51 @@
require "application_system_test_case"
class VehiclesTest < ApplicationSystemTestCase
setup do
@vehicle = vehicles(:one)
end
test "visiting the index" do
visit vehicles_url
assert_selector "h1", text: "Vehicles"
end
test "should create vehicle" do
visit vehicles_url
click_on "New vehicle"
fill_in "Car brand", with: @vehicle.car_brand
fill_in "Fuel type", with: @vehicle.fuel_type
fill_in "License plate", with: @vehicle.license_plate
fill_in "Model", with: @vehicle.model
fill_in "Model year", with: @vehicle.model_year
fill_in "Type", with: @vehicle.type
click_on "Create Vehicle"
assert_text "Vehicle was successfully created"
click_on "Back"
end
test "should update Vehicle" do
visit vehicle_url(@vehicle)
click_on "Edit this vehicle", match: :first
fill_in "Car brand", with: @vehicle.car_brand
fill_in "Fuel type", with: @vehicle.fuel_type
fill_in "License plate", with: @vehicle.license_plate
fill_in "Model", with: @vehicle.model
fill_in "Model year", with: @vehicle.model_year.to_s
fill_in "Type", with: @vehicle.type
click_on "Update Vehicle"
assert_text "Vehicle was successfully updated"
click_on "Back"
end
test "should destroy Vehicle" do
visit vehicle_url(@vehicle)
click_on "Destroy this vehicle", match: :first
assert_text "Vehicle was successfully destroyed"
end
end