Basic feature implemented, very basic poc

This commit is contained in:
David Schärer 2024-07-16 20:22:59 +02:00
parent 216089a3e7
commit 48c0067076
118 changed files with 2113 additions and 20 deletions

View file

@ -0,0 +1,45 @@
require "application_system_test_case"
class ChecklistsTest < ApplicationSystemTestCase
setup do
@checklist = checklists(:one)
end
test "visiting the index" do
visit checklists_url
assert_selector "h1", text: "Checklists"
end
test "should create checklist" do
visit checklists_url
click_on "New checklist"
fill_in "Code", with: @checklist.code
fill_in "Description", with: @checklist.description
fill_in "Name", with: @checklist.name
click_on "Create Checklist"
assert_text "Checklist was successfully created"
click_on "Back"
end
test "should update Checklist" do
visit checklist_url(@checklist)
click_on "Edit this checklist", match: :first
fill_in "Code", with: @checklist.code
fill_in "Description", with: @checklist.description
fill_in "Name", with: @checklist.name
click_on "Update Checklist"
assert_text "Checklist was successfully updated"
click_on "Back"
end
test "should destroy Checklist" do
visit checklist_url(@checklist)
click_on "Destroy this checklist", match: :first
assert_text "Checklist was successfully destroyed"
end
end

View file

@ -0,0 +1,47 @@
require "application_system_test_case"
class ChecksTest < ApplicationSystemTestCase
setup do
@check = checks(:one)
end
test "visiting the index" do
visit checks_url
assert_selector "h1", text: "Checks"
end
test "should create check" do
visit checks_url
click_on "New check"
fill_in "Level", with: @check.level
fill_in "Name", with: @check.name
fill_in "Position", with: @check.position
fill_in "Success criterion", with: @check.success_criterion
click_on "Create Check"
assert_text "Check was successfully created"
click_on "Back"
end
test "should update Check" do
visit check_url(@check)
click_on "Edit this check", match: :first
fill_in "Level", with: @check.level
fill_in "Name", with: @check.name
fill_in "Position", with: @check.position
fill_in "Success criterion", with: @check.success_criterion
click_on "Update Check"
assert_text "Check was successfully updated"
click_on "Back"
end
test "should destroy Check" do
visit check_url(@check)
click_on "Destroy this check", match: :first
assert_text "Check was successfully destroyed"
end
end

View file

@ -0,0 +1,47 @@
require "application_system_test_case"
class ElementsTest < ApplicationSystemTestCase
setup do
@element = elements(:one)
end
test "visiting the index" do
visit elements_url
assert_selector "h1", text: "Elements"
end
test "should create element" do
visit elements_url
click_on "New element"
fill_in "Description", with: @element.description
fill_in "Path", with: @element.path
fill_in "Report", with: @element.report_id
fill_in "Title", with: @element.title
click_on "Create Element"
assert_text "Element was successfully created"
click_on "Back"
end
test "should update Element" do
visit element_url(@element)
click_on "Edit this element", match: :first
fill_in "Description", with: @element.description
fill_in "Path", with: @element.path
fill_in "Report", with: @element.report_id
fill_in "Title", with: @element.title
click_on "Update Element"
assert_text "Element was successfully updated"
click_on "Back"
end
test "should destroy Element" do
visit element_url(@element)
click_on "Destroy this element", match: :first
assert_text "Element was successfully destroyed"
end
end

View file

@ -0,0 +1,43 @@
require "application_system_test_case"
class ReportsTest < ApplicationSystemTestCase
setup do
@report = reports(:one)
end
test "visiting the index" do
visit reports_url
assert_selector "h1", text: "Reports"
end
test "should create report" do
visit reports_url
click_on "New report"
fill_in "Comment", with: @report.comment
fill_in "Name", with: @report.name
click_on "Create Report"
assert_text "Report was successfully created"
click_on "Back"
end
test "should update Report" do
visit report_url(@report)
click_on "Edit this report", match: :first
fill_in "Comment", with: @report.comment
fill_in "Name", with: @report.name
click_on "Update Report"
assert_text "Report was successfully updated"
click_on "Back"
end
test "should destroy Report" do
visit report_url(@report)
click_on "Destroy this report", match: :first
assert_text "Report was successfully destroyed"
end
end

View file

@ -0,0 +1,51 @@
require "application_system_test_case"
class SuccessCriteriaTest < ApplicationSystemTestCase
setup do
@success_criterion = success_criteria(:one)
end
test "visiting the index" do
visit success_criteria_url
assert_selector "h1", text: "Success criteria"
end
test "should create success criterion" do
visit success_criteria_url
click_on "New success criterion"
fill_in "Comment", with: @success_criterion.comment
fill_in "Description", with: @success_criterion.description
fill_in "Element", with: @success_criterion.element_id
fill_in "Level", with: @success_criterion.level
fill_in "Result", with: @success_criterion.result
fill_in "Title", with: @success_criterion.title
click_on "Create Success criterion"
assert_text "Success criterion was successfully created"
click_on "Back"
end
test "should update Success criterion" do
visit success_criterion_url(@success_criterion)
click_on "Edit this success criterion", match: :first
fill_in "Comment", with: @success_criterion.comment
fill_in "Description", with: @success_criterion.description
fill_in "Element", with: @success_criterion.element_id
fill_in "Level", with: @success_criterion.level
fill_in "Result", with: @success_criterion.result
fill_in "Title", with: @success_criterion.title
click_on "Update Success criterion"
assert_text "Success criterion was successfully updated"
click_on "Back"
end
test "should destroy Success criterion" do
visit success_criterion_url(@success_criterion)
click_on "Destroy this success criterion", match: :first
assert_text "Success criterion was successfully destroyed"
end
end