a11yist/test/system/pages_test.rb

46 lines
963 B
Ruby
Raw Normal View History

2024-10-31 23:13:18 +01:00
require "application_system_test_case"
class PagesTest < ApplicationSystemTestCase
setup do
@page = pages(:one)
2024-11-03 21:58:25 +01:00
login_test
end
teardown do
logout
2024-10-31 23:13:18 +01:00
end
test "visiting the index" do
2024-11-03 21:58:25 +01:00
visit report_pages_url(@page.report)
assert_selector "h1", text: "Pfade"
2024-10-31 23:13:18 +01:00
end
test "should create page" do
2024-11-03 21:58:25 +01:00
visit report_pages_url(@page.report)
click_on "Pfad hinzufügen"
2024-10-31 23:13:18 +01:00
2024-11-03 21:58:25 +01:00
fill_in "Name", with: @page.path
2024-10-31 23:13:18 +01:00
fill_in "Url", with: @page.url
2024-11-03 21:58:25 +01:00
click_on "Pfad erstellen"
2024-10-31 23:13:18 +01:00
2024-11-03 21:58:25 +01:00
assert_text "Prüfbericht bearbeiten"
2024-10-31 23:13:18 +01:00
end
test "should update Page" do
visit page_url(@page)
2024-11-03 21:58:25 +01:00
click_on "Pfad bearbeiten", match: :first
2024-10-31 23:13:18 +01:00
2024-11-03 21:58:25 +01:00
fill_in "Name", with: @page.path
2024-10-31 23:13:18 +01:00
fill_in "Url", with: @page.url
2024-11-03 21:58:25 +01:00
click_on "Pfad aktualisieren"
2024-10-31 23:13:18 +01:00
end
test "should destroy Page" do
visit page_url(@page)
2024-11-03 21:58:25 +01:00
click_on "Pfad löschen", match: :first
2024-10-31 23:13:18 +01:00
2024-11-11 01:40:04 +01:00
assert_text "Prüfbericht löschen"
2024-11-03 21:58:25 +01:00
assert(Page.exists?(@page.id) == false)
2024-10-31 23:13:18 +01:00
end
end