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