45 lines
963 B
Ruby
45 lines
963 B
Ruby
require "application_system_test_case"
|
|
|
|
class PagesTest < ApplicationSystemTestCase
|
|
setup do
|
|
@page = pages(:one)
|
|
login_test
|
|
end
|
|
|
|
teardown do
|
|
logout
|
|
end
|
|
|
|
test "visiting the index" do
|
|
visit report_pages_url(@page.report)
|
|
assert_selector "h1", text: "Pfade"
|
|
end
|
|
|
|
test "should create page" do
|
|
visit report_pages_url(@page.report)
|
|
click_on "Pfad hinzufügen"
|
|
|
|
fill_in "Name", with: @page.path
|
|
fill_in "Url", with: @page.url
|
|
click_on "Pfad erstellen"
|
|
|
|
assert_text "Prüfbericht bearbeiten"
|
|
end
|
|
|
|
test "should update Page" do
|
|
visit page_url(@page)
|
|
click_on "Pfad bearbeiten", match: :first
|
|
|
|
fill_in "Name", with: @page.path
|
|
fill_in "Url", with: @page.url
|
|
click_on "Pfad aktualisieren"
|
|
end
|
|
|
|
test "should destroy Page" do
|
|
visit page_url(@page)
|
|
click_on "Pfad löschen", match: :first
|
|
|
|
assert_text "Prüfbericht löschen"
|
|
assert(Page.exists?(@page.id) == false)
|
|
end
|
|
end
|