a11yist/test/system/link_categories_test.rb

44 lines
1.1 KiB
Ruby
Raw Normal View History

2024-09-05 22:54:38 +02:00
# frozen_string_literal: true
require "application_system_test_case"
2024-07-26 00:59:00 +02:00
class LinkCategoriesTest < ApplicationSystemTestCase
setup do
@link_category = link_categories(:one)
2024-09-22 22:49:53 +02:00
login_test
end
teardown do
logout
2024-07-26 00:59:00 +02:00
end
2024-09-05 22:54:38 +02:00
test "visiting the index" do
2024-07-26 00:59:00 +02:00
visit link_categories_url
2024-09-05 22:54:38 +02:00
assert_selector "h1", text: "Linkkategorien"
2024-07-26 00:59:00 +02:00
end
2024-09-05 22:54:38 +02:00
test "should create Linkkategorie" do
2024-07-26 00:59:00 +02:00
visit link_categories_url
2024-09-05 22:54:38 +02:00
click_on "Linkkategorie hinzufügen"
2024-07-26 00:59:00 +02:00
2024-09-11 22:43:26 +02:00
fill_in_rich_text_area "Beschreibung", with: @link_category.description
2024-09-05 22:54:38 +02:00
fill_in "Name", with: @link_category.name
click_on "Linkkategorie erstellen"
2024-07-26 00:59:00 +02:00
end
2024-09-05 22:54:38 +02:00
test "should update Link category" do
2024-07-26 00:59:00 +02:00
visit link_category_url(@link_category)
2024-09-05 22:54:38 +02:00
click_on "Linkkategorie bearbeiten", match: :first
2024-07-26 00:59:00 +02:00
2024-09-11 22:43:26 +02:00
fill_in_rich_text_area "Beschreibung", with: @link_category.description
2024-09-05 22:54:38 +02:00
fill_in "Name", with: @link_category.name
click_on "Linkkategorie aktualisieren"
2024-07-26 00:59:00 +02:00
end
2024-09-05 22:54:38 +02:00
test "should destroy Link category" do
2024-07-26 00:59:00 +02:00
link_category = link_categories(:deletable)
visit link_category_url(link_category)
2024-09-05 22:54:38 +02:00
click_on "Linkkategorie löschen", match: :first
2024-07-26 00:59:00 +02:00
end
end