start of iteration 2
Some checks failed
/ Run tests (push) Failing after 1m19s
/ Run system tests (push) Failing after 1m18s
/ Build, push and deploy image (push) Has been skipped

This commit is contained in:
david 2024-10-31 23:13:18 +01:00
parent 9fb87a74ce
commit 729ed13521
75 changed files with 705 additions and 170 deletions

View file

@ -0,0 +1,48 @@
require "test_helper"
class PagesControllerTest < ActionDispatch::IntegrationTest
setup do
@page = pages(:one)
end
test "should get index" do
get pages_url
assert_response :success
end
test "should get new" do
get new_page_url
assert_response :success
end
test "should create page" do
assert_difference("Page.count") do
post pages_url, params: { page: { path: @page.path, position: @page.position, report_id: @page.report_id, url: @page.url } }
end
assert_redirected_to page_url(Page.last)
end
test "should show page" do
get page_url(@page)
assert_response :success
end
test "should get edit" do
get edit_page_url(@page)
assert_response :success
end
test "should update page" do
patch page_url(@page), params: { page: { path: @page.path, position: @page.position, report_id: @page.report_id, url: @page.url } }
assert_redirected_to page_url(@page)
end
test "should destroy page" do
assert_difference("Page.count", -1) do
delete page_url(@page)
end
assert_redirected_to pages_url
end
end

View file

@ -35,7 +35,7 @@ class ReportsControllerTest < ActionDispatch::IntegrationTest
test "should create report" do
assert_difference("Report.count") do
post reports_url, params: { report: { comment_html: @report.comment_html, name: @report.name } }
post reports_url, params: { report: { comment: @report.comment, name: @report.name } }
end
assert_redirected_to report_url(Report.last)
@ -52,7 +52,7 @@ class ReportsControllerTest < ActionDispatch::IntegrationTest
end
test "should update report" do
patch report_url(@report), params: { report: { comment_html: @report.comment_html, name: @report.name } }
patch report_url(@report), params: { report: { comment: @report.comment, name: @report.name } }
assert_redirected_to report_url(@report)
end

View file

@ -36,7 +36,7 @@ class SuccessCriteriaControllerTest < ActionDispatch::IntegrationTest
test "should create success_criterion" do
assert_difference("SuccessCriterion.count") do
post success_criteria_url,
params: { success_criterion: { comment_html: @success_criterion.comment_html,
params: { success_criterion: { comment: @success_criterion.comment,
description_html: @success_criterion.description_html, element_id: @success_criterion.element_id, level: @success_criterion.level, result: @success_criterion.result, title: @success_criterion.title } }
end
@ -55,7 +55,7 @@ class SuccessCriteriaControllerTest < ActionDispatch::IntegrationTest
test "should update success_criterion" do
patch success_criterion_url(@success_criterion),
params: { success_criterion: { comment_html: @success_criterion.comment_html,
params: { success_criterion: { comment: @success_criterion.comment,
description_html: @success_criterion.description_html, element_id: @success_criterion.element_id, level: @success_criterion.level, result: @success_criterion.result, title: @success_criterion.title } }
assert_redirected_to success_criterion_url(@success_criterion)
end

13
test/fixtures/pages.yml vendored Normal file
View file

@ -0,0 +1,13 @@
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
position: 1
path: MyString
url: MyString
report: one
two:
position: 1
path: MyString
url: MyString
report: two

7
test/models/page_test.rb Normal file
View file

@ -0,0 +1,7 @@
require "test_helper"
class PageTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end

47
test/system/pages_test.rb Normal file
View file

@ -0,0 +1,47 @@
require "application_system_test_case"
class PagesTest < ApplicationSystemTestCase
setup do
@page = pages(:one)
end
test "visiting the index" do
visit pages_url
assert_selector "h1", text: "Pages"
end
test "should create page" do
visit pages_url
click_on "New page"
fill_in "Path", with: @page.path
fill_in "Position", with: @page.position
fill_in "Report", with: @page.report_id
fill_in "Url", with: @page.url
click_on "Create Page"
assert_text "Page was successfully created"
click_on "Back"
end
test "should update Page" do
visit page_url(@page)
click_on "Edit this page", match: :first
fill_in "Path", with: @page.path
fill_in "Position", with: @page.position
fill_in "Report", with: @page.report_id
fill_in "Url", with: @page.url
click_on "Update Page"
assert_text "Page was successfully updated"
click_on "Back"
end
test "should destroy Page" do
visit page_url(@page)
click_on "Destroy this page", match: :first
assert_text "Page was successfully destroyed"
end
end

View file

@ -21,7 +21,7 @@ class ReportsTest < ApplicationSystemTestCase
visit reports_url
click_on "Prüfbericht hinzufügen"
fill_in_rich_text_area "Projektbeschreibung", with: @report.comment_html
fill_in_rich_text_area "Projektbeschreibung", with: @report.comment
fill_in "Bezeichnung", with: @report.name
click_on "Prüfbericht erstellen"
end
@ -30,7 +30,7 @@ class ReportsTest < ApplicationSystemTestCase
visit report_url(@report)
click_on "Prüfbericht bearbeiten", match: :first
fill_in_rich_text_area "Projektbeschreibung", with: @report.comment_html
fill_in_rich_text_area "Projektbeschreibung", with: @report.comment
fill_in "Bezeichnung", with: @report.name
click_on "Prüfbericht aktualisieren"
end

View file

@ -21,7 +21,7 @@ class SuccessCriteriaTest < ApplicationSystemTestCase
visit success_criteria_url
click_on "Erfolgskriterium hinzufügen"
fill_in_rich_text_area "Testkommentar", with: @success_criterion.comment_html
fill_in_rich_text_area "Testkommentar", with: @success_criterion.comment
fill_in_rich_text_area "Richtlinie", with: @success_criterion.description_html
# fill_in 'Element', with: @success_criterion.element_id
# fill_in 'Level', with: @success_criterion.level
@ -34,7 +34,7 @@ class SuccessCriteriaTest < ApplicationSystemTestCase
visit success_criterion_url(@success_criterion)
click_on "Erfolgskriterium bearbeiten", match: :first
fill_in_rich_text_area "Testkommentar", with: @success_criterion.comment_html
fill_in_rich_text_area "Testkommentar", with: @success_criterion.comment
fill_in_rich_text_area "Richtlinie", with: @success_criterion.description_html
find("label", text: "Bestanden", visible: true).click
fill_in "Titel", with: "new"