2024-09-05 22:54:38 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
|
|
require "application_system_test_case"
|
2024-07-16 20:22:59 +02:00
|
|
|
|
|
|
|
|
class ReportsTest < ApplicationSystemTestCase
|
|
|
|
|
setup do
|
|
|
|
|
@report = reports(:one)
|
2024-09-22 22:49:53 +02:00
|
|
|
login_test
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
teardown do
|
|
|
|
|
logout
|
2024-07-16 20:22:59 +02:00
|
|
|
end
|
|
|
|
|
|
2024-09-05 22:54:38 +02:00
|
|
|
test "visiting the index" do
|
2024-07-16 20:22:59 +02:00
|
|
|
visit reports_url
|
2024-09-05 22:54:38 +02:00
|
|
|
assert_selector "h1", text: "Prüfberichte"
|
2024-07-16 20:22:59 +02:00
|
|
|
end
|
|
|
|
|
|
2024-09-05 22:54:38 +02:00
|
|
|
test "should create report" do
|
2024-07-16 20:22:59 +02:00
|
|
|
visit reports_url
|
2024-09-05 22:54:38 +02:00
|
|
|
click_on "Prüfbericht hinzufügen"
|
2024-07-16 20:22:59 +02:00
|
|
|
|
2024-10-31 23:13:18 +01:00
|
|
|
fill_in_rich_text_area "Projektbeschreibung", with: @report.comment
|
2024-09-05 22:54:38 +02:00
|
|
|
fill_in "Bezeichnung", with: @report.name
|
|
|
|
|
click_on "Prüfbericht erstellen"
|
2024-07-16 20:22:59 +02:00
|
|
|
end
|
|
|
|
|
|
2024-09-05 22:54:38 +02:00
|
|
|
test "should update Report" do
|
2024-07-16 20:22:59 +02:00
|
|
|
visit report_url(@report)
|
2024-09-05 22:54:38 +02:00
|
|
|
click_on "Prüfbericht bearbeiten", match: :first
|
2024-07-16 20:22:59 +02:00
|
|
|
|
2024-10-31 23:13:18 +01:00
|
|
|
fill_in_rich_text_area "Projektbeschreibung", with: @report.comment
|
2024-09-05 22:54:38 +02:00
|
|
|
fill_in "Bezeichnung", with: @report.name
|
|
|
|
|
click_on "Prüfbericht aktualisieren"
|
2024-07-16 20:22:59 +02:00
|
|
|
end
|
|
|
|
|
|
2024-09-05 22:54:38 +02:00
|
|
|
test "should destroy Report" do
|
2024-07-16 20:22:59 +02:00
|
|
|
visit report_url(@report)
|
2024-09-05 22:54:38 +02:00
|
|
|
click_on "Prüfbericht löschen", match: :first
|
2024-11-03 21:58:25 +01:00
|
|
|
assert_text("Prüfberichte")
|
2024-09-11 22:43:26 +02:00
|
|
|
assert(Report.exists?(@report.id) == false)
|
2024-07-16 20:22:59 +02:00
|
|
|
end
|
|
|
|
|
end
|