initial commit

This commit is contained in:
Stefan Tollkühn
2025-07-21 12:14:42 +02:00
parent a77fc87832
commit 3735122750
156 changed files with 3862 additions and 1 deletions

0
test/system/.keep Normal file
View File

View File

@@ -0,0 +1,57 @@
require "application_system_test_case"
class ClientsTest < ApplicationSystemTestCase
setup do
@client = clients(:one)
end
test "visiting the index" do
visit clients_url
assert_selector "h1", text: "Clients"
end
test "should create client" do
visit clients_url
click_on "New client"
fill_in "City", with: @client.city
fill_in "Company name", with: @client.company_name
fill_in "Country", with: @client.country
fill_in "Email", with: @client.email
fill_in "Firstname", with: @client.firstname
fill_in "Lastname", with: @client.lastname
fill_in "Phone", with: @client.phone
fill_in "Streetname", with: @client.streetname
fill_in "Zipcode", with: @client.zipcode
click_on "Create Client"
assert_text "Client was successfully created"
click_on "Back"
end
test "should update Client" do
visit client_url(@client)
click_on "Edit this client", match: :first
fill_in "City", with: @client.city
fill_in "Company name", with: @client.company_name
fill_in "Country", with: @client.country
fill_in "Email", with: @client.email
fill_in "Firstname", with: @client.firstname
fill_in "Lastname", with: @client.lastname
fill_in "Phone", with: @client.phone
fill_in "Streetname", with: @client.streetname
fill_in "Zipcode", with: @client.zipcode
click_on "Update Client"
assert_text "Client was successfully updated"
click_on "Back"
end
test "should destroy Client" do
visit client_url(@client)
click_on "Destroy this client", match: :first
assert_text "Client was successfully destroyed"
end
end

View File

@@ -0,0 +1,41 @@
require "application_system_test_case"
class ProjectsTest < ApplicationSystemTestCase
setup do
@project = projects(:one)
end
test "visiting the index" do
visit projects_url
assert_selector "h1", text: "Projects"
end
test "should create project" do
visit projects_url
click_on "New project"
fill_in "Name", with: @project.name
click_on "Create Project"
assert_text "Project was successfully created"
click_on "Back"
end
test "should update Project" do
visit project_url(@project)
click_on "Edit this project", match: :first
fill_in "Name", with: @project.name
click_on "Update Project"
assert_text "Project was successfully updated"
click_on "Back"
end
test "should destroy Project" do
visit project_url(@project)
click_on "Destroy this project", match: :first
assert_text "Project was successfully destroyed"
end
end

View File

@@ -0,0 +1,49 @@
require "application_system_test_case"
class SubprojectsTest < ApplicationSystemTestCase
setup do
@subproject = subprojects(:one)
end
test "visiting the index" do
visit subprojects_url
assert_selector "h1", text: "Subprojects"
end
test "should create subproject" do
visit subprojects_url
click_on "New subproject"
fill_in "Builder", with: @subproject.builder_id
fill_in "Client", with: @subproject.client_id
fill_in "Owner", with: @subproject.owner_id
fill_in "Project", with: @subproject.project_id
fill_in "Subproject name", with: @subproject.subproject_name
click_on "Create Subproject"
assert_text "Subproject was successfully created"
click_on "Back"
end
test "should update Subproject" do
visit subproject_url(@subproject)
click_on "Edit this subproject", match: :first
fill_in "Builder", with: @subproject.builder_id
fill_in "Client", with: @subproject.client_id
fill_in "Owner", with: @subproject.owner_id
fill_in "Project", with: @subproject.project_id
fill_in "Subproject name", with: @subproject.subproject_name
click_on "Update Subproject"
assert_text "Subproject was successfully updated"
click_on "Back"
end
test "should destroy Subproject" do
visit subproject_url(@subproject)
click_on "Destroy this subproject", match: :first
assert_text "Subproject was successfully destroyed"
end
end