a11yist/test/system/guidelines_test.rb

46 lines
1.2 KiB
Ruby
Raw Permalink Normal View History

2025-05-16 19:02:33 +02:00
require "application_system_test_case"
class GuidelinesTest < ApplicationSystemTestCase
setup do
@guideline = guidelines(:one)
end
test "visiting the index" do
visit guidelines_url
assert_selector "h1", text: "Guidelines"
end
test "should create guideline" do
visit guidelines_url
click_on "New guideline"
fill_in "Name de", with: @guideline.name_de
fill_in "Number", with: @guideline.number
fill_in "Principle", with: @guideline.principle_id
click_on "Create Guideline"
assert_text "Guideline was successfully created"
click_on "Back"
end
test "should update Guideline" do
visit guideline_url(@guideline)
click_on "Edit this guideline", match: :first
fill_in "Name de", with: @guideline.name_de
fill_in "Number", with: @guideline.number
fill_in "Principle", with: @guideline.principle_id
click_on "Update Guideline"
assert_text "Guideline was successfully updated"
click_on "Back"
end
test "should destroy Guideline" do
visit guideline_url(@guideline)
click_on "Destroy this guideline", match: :first
assert_text "Guideline was successfully destroyed"
end
end