a11yist/test/system/reports_test.rb

36 lines
920 B
Ruby
Raw Normal View History

2024-07-23 01:06:45 +02:00
require 'application_system_test_case'
class ReportsTest < ApplicationSystemTestCase
setup do
@report = reports(:one)
end
2024-07-23 01:06:45 +02:00
test 'visiting the index' do
visit reports_url
2024-07-23 01:06:45 +02:00
assert_selector 'h1', text: 'Prüfberichte'
end
2024-07-23 01:06:45 +02:00
test 'should create report' do
visit reports_url
2024-07-23 01:06:45 +02:00
click_on 'Prüfbericht hinzufügen'
2024-07-23 01:06:45 +02:00
fill_in_rich_text_area 'Projektbeschreibung', with: @report.comment_html
fill_in 'Bezeichnung', with: @report.name
click_on 'Prüfbericht erstellen'
end
2024-07-23 01:06:45 +02:00
test 'should update Report' do
visit report_url(@report)
2024-07-23 01:06:45 +02:00
click_on 'Prüfbericht bearbeiten', match: :first
2024-07-23 01:06:45 +02:00
fill_in_rich_text_area 'Projektbeschreibung', with: @report.comment_html
fill_in 'Bezeichnung', with: @report.name
click_on 'Prüfbericht aktualisieren'
end
2024-07-23 01:06:45 +02:00
test 'should destroy Report' do
visit report_url(@report)
2024-07-23 01:06:45 +02:00
click_on 'Prüfbericht löschen', match: :first
end
end