a11yist/test/system/links_test.rb

45 lines
944 B
Ruby
Raw Permalink 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 LinksTest < ApplicationSystemTestCase
setup do
@link = links(: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 links_url
2024-09-05 22:54:38 +02:00
assert_selector "h1", text: "Links"
2024-07-26 00:59:00 +02:00
end
2024-09-05 22:54:38 +02:00
test "should create link" do
2024-07-26 00:59:00 +02:00
visit links_url
2024-09-05 22:54:38 +02:00
click_on "Link hinzufügen"
2024-07-26 00:59:00 +02:00
2024-09-05 22:54:38 +02:00
select @link.link_category.name, from: "Kategorie"
fill_in "Linktext", with: @link.text
fill_in "Link", with: @link.url
click_on "Link erstellen"
2024-07-26 00:59:00 +02:00
end
2024-09-05 22:54:38 +02:00
test "should update Link" do
2024-07-26 00:59:00 +02:00
visit link_url(@link)
2024-09-05 22:54:38 +02:00
click_on "Link bearbeiten", match: :first
2024-07-26 00:59:00 +02:00
2024-09-05 22:54:38 +02:00
select @link.link_category.name, from: "Kategorie"
fill_in "Linktext", with: @link.text
fill_in "Link", with: @link.url
click_on "Link aktualisieren"
2024-07-26 00:59:00 +02:00
end
2024-09-05 22:54:38 +02:00
test "should destroy Link" do
2024-07-26 00:59:00 +02:00
visit link_url(@link)
2024-09-05 22:54:38 +02:00
click_on "Link löschen", match: :first
2024-07-26 00:59:00 +02:00
end
end