A lot :)
This commit is contained in:
parent
aad67af0d1
commit
63fc206c27
153 changed files with 2043 additions and 646 deletions
|
|
@ -1,14 +1,15 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'test_helper'
|
||||
require "test_helper"
|
||||
|
||||
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
|
||||
driven_by(:selenium, using: :headless_chrome,
|
||||
options: { browser: :remote, url: ENV.fetch('SELENIUM_REMOTE_URL', nil) })
|
||||
options: { browser: :remote,
|
||||
url: ENV.fetch("SELENIUM_REMOTE_URL", nil) })
|
||||
|
||||
def setup
|
||||
Capybara.server_host = '0.0.0.0' # bind to all interfaces
|
||||
Capybara.app_host = "http://#{IPSocket.getaddress(Socket.gethostname)}" if ENV['SELENIUM_REMOTE_URL'].present?
|
||||
Capybara.server_host = "0.0.0.0" # bind to all interfaces
|
||||
Capybara.app_host = "http://#{IPSocket.getaddress(Socket.gethostname)}" if ENV["SELENIUM_REMOTE_URL"].present?
|
||||
|
||||
super
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'test_helper'
|
||||
require "test_helper"
|
||||
|
||||
module ApplicationCable
|
||||
class ConnectionTest < ActionCable::Connection::TestCase
|
||||
|
|
|
|||
|
|
@ -1,8 +1,12 @@
|
|||
require 'test_helper'
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Admin::BackupsControllerTest < ActionDispatch::IntegrationTest
|
||||
test 'should show admin_backup' do
|
||||
get admin_backup_url(@admin_backup)
|
||||
assert_response :success
|
||||
require "test_helper"
|
||||
|
||||
module Admin
|
||||
class BackupsControllerTest < ActionDispatch::IntegrationTest
|
||||
test "should show admin_backup" do
|
||||
get admin_backup_url(@admin_backup)
|
||||
assert_response :success
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,22 +1,24 @@
|
|||
require 'test_helper'
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "test_helper"
|
||||
|
||||
class ChecklistEntriesControllerTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
@checklist_entry = checklist_entries(:one)
|
||||
end
|
||||
|
||||
test 'should get index' do
|
||||
test "should get index" do
|
||||
get checklist_entries_url
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test 'should get new' do
|
||||
test "should get new" do
|
||||
get new_checklist_entry_url(checklist_id: @checklist_entry.checklist_id)
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test 'should create checklist_entry' do
|
||||
assert_difference('ChecklistEntry.count') do
|
||||
test "should create checklist_entry" do
|
||||
assert_difference("ChecklistEntry.count") do
|
||||
post checklist_entries_url,
|
||||
params: { checklist_entry: { check_id: @checklist_entry.check_id, checklist_id: @checklist_entry.checklist_id,
|
||||
position: @checklist_entry.position } }
|
||||
|
|
@ -25,25 +27,25 @@ class ChecklistEntriesControllerTest < ActionDispatch::IntegrationTest
|
|||
assert_redirected_to checklist_url(ChecklistEntry.last.checklist)
|
||||
end
|
||||
|
||||
test 'should show checklist_entry' do
|
||||
test "should show checklist_entry" do
|
||||
get checklist_entry_url(@checklist_entry)
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test 'should get edit' do
|
||||
test "should get edit" do
|
||||
get edit_checklist_entry_url(@checklist_entry)
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test 'should update checklist_entry' do
|
||||
test "should update checklist_entry" do
|
||||
patch checklist_entry_url(@checklist_entry),
|
||||
params: { checklist_entry: { check_id: @checklist_entry.check_id, checklist_id: @checklist_entry.checklist_id,
|
||||
position: @checklist_entry.position } }
|
||||
assert_redirected_to checklist_url(@checklist_entry.checklist)
|
||||
end
|
||||
|
||||
test 'should destroy checklist_entry' do
|
||||
assert_difference('ChecklistEntry.count', -1) do
|
||||
test "should destroy checklist_entry" do
|
||||
assert_difference("ChecklistEntry.count", -1) do
|
||||
delete checklist_entry_url(@checklist_entry)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "test_helper"
|
||||
|
||||
class ChecklistsControllerTest < ActionDispatch::IntegrationTest
|
||||
|
|
@ -17,7 +19,9 @@ class ChecklistsControllerTest < ActionDispatch::IntegrationTest
|
|||
|
||||
test "should create checklist" do
|
||||
assert_difference("Checklist.count") do
|
||||
post checklists_url, params: { checklist: { code: @checklist.code, description_html: @checklist.description_html, name: @checklist.name } }
|
||||
post checklists_url,
|
||||
params: { checklist: { code: @checklist.code, description_html: @checklist.description_html,
|
||||
name: @checklist.name } }
|
||||
end
|
||||
|
||||
assert_redirected_to checklist_url(Checklist.last)
|
||||
|
|
@ -34,7 +38,9 @@ class ChecklistsControllerTest < ActionDispatch::IntegrationTest
|
|||
end
|
||||
|
||||
test "should update checklist" do
|
||||
patch checklist_url(@checklist), params: { checklist: { code: @checklist.code, description_html: @checklist.description_html, name: @checklist.name } }
|
||||
patch checklist_url(@checklist),
|
||||
params: { checklist: { code: @checklist.code, description_html: @checklist.description_html,
|
||||
name: @checklist.name } }
|
||||
assert_redirected_to checklist_url(@checklist)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,49 +1,52 @@
|
|||
require 'test_helper'
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "test_helper"
|
||||
|
||||
class ChecksControllerTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
@principle = principles(:one)
|
||||
@check = checks(:deletable)
|
||||
end
|
||||
|
||||
test 'should get index' do
|
||||
test "should get index" do
|
||||
get checks_url
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test 'should get new' do
|
||||
test "should get new" do
|
||||
get new_check_url
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test 'should create check' do
|
||||
assert_difference('Check.count') do
|
||||
test "should create check" do
|
||||
assert_difference("Check.count") do
|
||||
post checks_url,
|
||||
params: { check: { level: @check.level, name: @check.name, position: @check.position,
|
||||
success_criterion_html: @check.success_criterion_html } }
|
||||
params: { check: { principle_id: @principle.id, level: @check.level, name_de: @check.name_de, position: @check.position,
|
||||
criterion_de: @check.criterion_de } }
|
||||
end
|
||||
|
||||
assert_redirected_to check_url(Check.last)
|
||||
end
|
||||
|
||||
test 'should show check' do
|
||||
test "should show check" do
|
||||
get check_url(@check)
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test 'should get edit' do
|
||||
test "should get edit" do
|
||||
get edit_check_url(@check)
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test 'should update check' do
|
||||
test "should update check" do
|
||||
patch check_url(@check),
|
||||
params: { check: { level: @check.level, name: @check.name, position: @check.position,
|
||||
success_criterion_html: @check.success_criterion_html } }
|
||||
params: { check: { principle_id: @principle.id, level: @check.level, name_de: @check.t_name, position: @check.position,
|
||||
criterion_de: @check.criterion_de } }
|
||||
assert_redirected_to check_url(@check)
|
||||
end
|
||||
|
||||
test 'should destroy check' do
|
||||
assert_difference('Check.count', -1) do
|
||||
test "should destroy check" do
|
||||
assert_difference("Check.count", -1) do
|
||||
delete check_url(@check)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
require 'test_helper'
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "test_helper"
|
||||
|
||||
class ElementsControllerTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
|
|
@ -6,18 +8,18 @@ class ElementsControllerTest < ActionDispatch::IntegrationTest
|
|||
@checklist = checklists(:one)
|
||||
end
|
||||
|
||||
test 'should get index' do
|
||||
test "should get index" do
|
||||
get elements_url
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test 'should get new' do
|
||||
test "should get new" do
|
||||
get new_element_url
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test 'should create element' do
|
||||
assert_difference('Element.count') do
|
||||
test "should create element" do
|
||||
assert_difference("Element.count") do
|
||||
post elements_url,
|
||||
params: { element: { description_html: @element.description_html, path: @element.path, report_id: @element.report_id,
|
||||
title: @element.title, checklist_id: @checklist.id } }
|
||||
|
|
@ -26,25 +28,25 @@ class ElementsControllerTest < ActionDispatch::IntegrationTest
|
|||
assert_redirected_to report_url(Element.last.report)
|
||||
end
|
||||
|
||||
test 'should show element' do
|
||||
test "should show element" do
|
||||
get element_url(@element)
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test 'should get edit' do
|
||||
test "should get edit" do
|
||||
get edit_element_url(@element)
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test 'should update element' do
|
||||
test "should update element" do
|
||||
patch element_url(@element),
|
||||
params: { element: { description_html: @element.description_html, path: @element.path, report_id: @element.report_id,
|
||||
title: @element.title } }
|
||||
assert_redirected_to element_url(@element)
|
||||
end
|
||||
|
||||
test 'should destroy element' do
|
||||
assert_difference('Element.count', -1) do
|
||||
test "should destroy element" do
|
||||
assert_difference("Element.count", -1) do
|
||||
delete element_url(@element)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'test_helper'
|
||||
require "test_helper"
|
||||
|
||||
class HomeControllerTest < ActionDispatch::IntegrationTest
|
||||
test 'should get show' do
|
||||
test "should get show" do
|
||||
get root_url
|
||||
assert_response :success
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "test_helper"
|
||||
|
||||
class LinkCategoriesControllerTest < ActionDispatch::IntegrationTest
|
||||
|
|
@ -17,7 +19,8 @@ class LinkCategoriesControllerTest < ActionDispatch::IntegrationTest
|
|||
|
||||
test "should create link_category" do
|
||||
assert_difference("LinkCategory.count") do
|
||||
post link_categories_url, params: { link_category: { description: @link_category.description, name: @link_category.name } }
|
||||
post link_categories_url,
|
||||
params: { link_category: { description: @link_category.description, name: @link_category.name } }
|
||||
end
|
||||
|
||||
assert_redirected_to link_category_url(LinkCategory.last)
|
||||
|
|
@ -34,7 +37,8 @@ class LinkCategoriesControllerTest < ActionDispatch::IntegrationTest
|
|||
end
|
||||
|
||||
test "should update link_category" do
|
||||
patch link_category_url(@link_category), params: { link_category: { description: @link_category.description, name: @link_category.name } }
|
||||
patch link_category_url(@link_category),
|
||||
params: { link_category: { description: @link_category.description, name: @link_category.name } }
|
||||
assert_redirected_to link_category_url(@link_category)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "test_helper"
|
||||
|
||||
class LinksControllerTest < ActionDispatch::IntegrationTest
|
||||
|
|
@ -17,7 +19,9 @@ class LinksControllerTest < ActionDispatch::IntegrationTest
|
|||
|
||||
test "should create link" do
|
||||
assert_difference("Link.count") do
|
||||
post links_url, params: { link: { fail_count: @link.fail_count, last_check_at: @link.last_check_at, link_category_id: @link.link_category_id, text: @link.text, url: @link.url } }
|
||||
post links_url,
|
||||
params: { link: { fail_count: @link.fail_count, last_check_at: @link.last_check_at,
|
||||
link_category_id: @link.link_category_id, text: @link.text, url: @link.url } }
|
||||
end
|
||||
|
||||
assert_redirected_to link_url(Link.last)
|
||||
|
|
@ -34,7 +38,9 @@ class LinksControllerTest < ActionDispatch::IntegrationTest
|
|||
end
|
||||
|
||||
test "should update link" do
|
||||
patch link_url(@link), params: { link: { fail_count: @link.fail_count, last_check_at: @link.last_check_at, link_category_id: @link.link_category_id, text: @link.text, url: @link.url } }
|
||||
patch link_url(@link),
|
||||
params: { link: { fail_count: @link.fail_count, last_check_at: @link.last_check_at,
|
||||
link_category_id: @link.link_category_id, text: @link.text, url: @link.url } }
|
||||
assert_redirected_to link_url(@link)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "test_helper"
|
||||
|
||||
class ReportsControllerTest < ActionDispatch::IntegrationTest
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "test_helper"
|
||||
|
||||
class SuccessCriteriaControllerTest < ActionDispatch::IntegrationTest
|
||||
|
|
@ -17,7 +19,9 @@ 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, description_html: @success_criterion.description_html, element_id: @success_criterion.element_id, level: @success_criterion.level, result: @success_criterion.result, title: @success_criterion.title } }
|
||||
post success_criteria_url,
|
||||
params: { success_criterion: { comment_html: @success_criterion.comment_html,
|
||||
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
|
||||
|
||||
assert_redirected_to success_criterion_url(SuccessCriterion.last)
|
||||
|
|
@ -34,7 +38,9 @@ class SuccessCriteriaControllerTest < ActionDispatch::IntegrationTest
|
|||
end
|
||||
|
||||
test "should update success_criterion" do
|
||||
patch success_criterion_url(@success_criterion), params: { success_criterion: { comment_html: @success_criterion.comment_html, description_html: @success_criterion.description_html, element_id: @success_criterion.element_id, level: @success_criterion.level, result: @success_criterion.result, title: @success_criterion.title } }
|
||||
patch success_criterion_url(@success_criterion),
|
||||
params: { success_criterion: { comment_html: @success_criterion.comment_html,
|
||||
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
|
||||
|
||||
|
|
|
|||
9
test/fixtures/principles.yml
vendored
Normal file
9
test/fixtures/principles.yml
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
one:
|
||||
name_de: MyString
|
||||
name_en: MyString
|
||||
|
||||
two:
|
||||
name_de: MyString
|
||||
name_en: MyString
|
||||
15
test/fixtures/standards.yml
vendored
Normal file
15
test/fixtures/standards.yml
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
one:
|
||||
name_de: MyString
|
||||
name_en: MyString
|
||||
version: MyString
|
||||
url_de: MyString
|
||||
url_en: MyString
|
||||
|
||||
two:
|
||||
name_de: MyString
|
||||
name_en: MyString
|
||||
version: MyString
|
||||
url_de: MyString
|
||||
url_en: MyString
|
||||
|
|
@ -1,8 +1,10 @@
|
|||
require 'test_helper'
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "test_helper"
|
||||
|
||||
class CheckTest < ActiveSupport::TestCase
|
||||
test 'the truth' do
|
||||
skip 'Need to write Check test'
|
||||
test "the truth" do
|
||||
skip "Need to write Check test"
|
||||
assert true
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "test_helper"
|
||||
|
||||
class ChecklistEntryTest < ActiveSupport::TestCase
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "test_helper"
|
||||
|
||||
class ChecklistTest < ActiveSupport::TestCase
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
require 'test_helper'
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "test_helper"
|
||||
|
||||
class ElementTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
test 'level calculation' do
|
||||
test "level calculation" do
|
||||
skip
|
||||
sc1 = success_criteria(:one)
|
||||
sc2 = success_criteria(:two)
|
||||
|
|
@ -13,12 +15,12 @@ class ElementTest < ActiveSupport::TestCase
|
|||
sc5 = success_criteria(:one)
|
||||
sc6 = success_criteria(:two)
|
||||
element = elements(:one)
|
||||
element.success_criteria = [sc1, sc2, sc3, sc4, sc5, sc6]
|
||||
element.success_criteria.each { _1.passed! }
|
||||
element.success_criteria = [ sc1, sc2, sc3, sc4, sc5, sc6 ]
|
||||
element.success_criteria.each(&:passed!)
|
||||
assert element.level == :A
|
||||
|
||||
element.success_criteria.each { _1.result = :passed }
|
||||
|
||||
assert element.level == 'A'
|
||||
assert element.level == "A"
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "test_helper"
|
||||
|
||||
class LinkCategoryTest < ActiveSupport::TestCase
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "test_helper"
|
||||
|
||||
class LinkTest < ActiveSupport::TestCase
|
||||
|
|
|
|||
7
test/models/principle_test.rb
Normal file
7
test/models/principle_test.rb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
require "test_helper"
|
||||
|
||||
class PrincipleTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
||||
|
|
@ -1,7 +1,9 @@
|
|||
require 'test_helper'
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "test_helper"
|
||||
|
||||
class ReportTest < ActiveSupport::TestCase
|
||||
test 'the truth' do
|
||||
test "the truth" do
|
||||
assert_not Report.new.valid?
|
||||
end
|
||||
end
|
||||
|
|
|
|||
7
test/models/standard_test.rb
Normal file
7
test/models/standard_test.rb
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
require "test_helper"
|
||||
|
||||
class StandardTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require "test_helper"
|
||||
|
||||
class SuccessCriterionTest < ActiveSupport::TestCase
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
require 'application_system_test_case'
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Admin::BackupsTest < ApplicationSystemTestCase
|
||||
test 'should create backup' do
|
||||
visit admin_backup_url
|
||||
require "application_system_test_case"
|
||||
|
||||
module Admin
|
||||
class BackupsTest < ApplicationSystemTestCase
|
||||
test "should create backup" do
|
||||
visit admin_backup_url
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,35 +1,37 @@
|
|||
require 'application_system_test_case'
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "application_system_test_case"
|
||||
|
||||
class ChecklistsTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
@checklist = checklists(:one)
|
||||
end
|
||||
|
||||
test 'visiting the index' do
|
||||
test "visiting the index" do
|
||||
visit checklists_url
|
||||
assert_selector 'h1', text: 'Checklisten'
|
||||
assert_selector "h1", text: "Checklisten"
|
||||
end
|
||||
|
||||
test 'should create checklist' do
|
||||
test "should create checklist" do
|
||||
visit checklists_url
|
||||
click_on 'Checkliste hinzufügen'
|
||||
click_on "Checkliste hinzufügen"
|
||||
|
||||
fill_in_rich_text_area 'Details', with: @checklist.description_html
|
||||
fill_in 'Überschrift', with: @checklist.name
|
||||
click_on 'Checkliste erstellen'
|
||||
fill_in_rich_text_area "Details", with: @checklist.description_html
|
||||
fill_in "Überschrift", with: @checklist.name
|
||||
click_on "Checkliste erstellen"
|
||||
end
|
||||
|
||||
test 'should update Checkliste' do
|
||||
test "should update Checkliste" do
|
||||
visit checklist_url(@checklist)
|
||||
click_on 'Checkliste bearbeiten', match: :first
|
||||
click_on "Checkliste bearbeiten", match: :first
|
||||
|
||||
fill_in_rich_text_area 'Details', with: @checklist.description_html
|
||||
fill_in 'Überschrift', with: @checklist.name
|
||||
click_on 'Checkliste aktualisieren'
|
||||
fill_in_rich_text_area "Details", with: @checklist.description_html
|
||||
fill_in "Überschrift", with: @checklist.name
|
||||
click_on "Checkliste aktualisieren"
|
||||
end
|
||||
|
||||
test 'should destroy Checkliste' do
|
||||
test "should destroy Checkliste" do
|
||||
visit checklist_url(@checklist)
|
||||
click_on 'Checkliste löschen', match: :first
|
||||
click_on "Checkliste löschen", match: :first
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
require 'application_system_test_case'
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "application_system_test_case"
|
||||
|
||||
class ChecksTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
|
|
@ -6,39 +8,39 @@ class ChecksTest < ApplicationSystemTestCase
|
|||
@deletable_check = checks(:deletable)
|
||||
end
|
||||
|
||||
test 'visiting the index' do
|
||||
test "visiting the index" do
|
||||
visit checks_url
|
||||
assert_selector 'h1', text: 'Checks'
|
||||
assert_selector "h1", text: "Checks"
|
||||
end
|
||||
|
||||
test 'should create check' do
|
||||
test "should create check" do
|
||||
visit checks_url
|
||||
click_on 'Check hinzufügen'
|
||||
click_on "Check hinzufügen"
|
||||
|
||||
select 'AAA', from: 'Stufe'
|
||||
fill_in 'Name', with: @check.name
|
||||
fill_in 'Position', with: @check.position
|
||||
fill_in_rich_text_area 'Erfolgskriterium', with: @check.success_criterion_html
|
||||
click_on 'Check erstellen'
|
||||
select "AAA", from: "Stufe"
|
||||
fill_in "Name", with: @check.name
|
||||
fill_in "Position", with: @check.position
|
||||
fill_in_rich_text_area "Erfolgskriterium", with: @check.success_criterion_html
|
||||
click_on "Check erstellen"
|
||||
end
|
||||
|
||||
test 'should update Check' do
|
||||
test "should update Check" do
|
||||
visit check_url(@check)
|
||||
click_on 'Check bearbeiten', match: :first
|
||||
click_on "Check bearbeiten", match: :first
|
||||
|
||||
select 'AAA', from: 'Stufe'
|
||||
fill_in 'Name', with: @check.name
|
||||
fill_in 'Position', with: @check.position
|
||||
fill_in_rich_text_area 'Erfolgskriterium', with: @check.success_criterion_html
|
||||
click_on 'Check aktualisieren'
|
||||
select "AAA", from: "Stufe"
|
||||
fill_in "Name", with: @check.name
|
||||
fill_in "Position", with: @check.position
|
||||
fill_in_rich_text_area "Erfolgskriterium", with: @check.success_criterion_html
|
||||
click_on "Check aktualisieren"
|
||||
end
|
||||
|
||||
test 'should destroy Check' do
|
||||
test "should destroy Check" do
|
||||
visit check_url(@deletable_check)
|
||||
click_on 'Check löschen', match: :first
|
||||
click_on "Check löschen", match: :first
|
||||
end
|
||||
|
||||
test 'fail' do
|
||||
test "fail" do
|
||||
skip
|
||||
assert false
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,37 +1,39 @@
|
|||
require 'application_system_test_case'
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "application_system_test_case"
|
||||
|
||||
class ElementsTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
@element = elements(:one)
|
||||
end
|
||||
|
||||
test 'visiting the index' do
|
||||
test "visiting the index" do
|
||||
visit elements_url
|
||||
assert_selector 'h1', text: 'Elemente'
|
||||
assert_selector "h1", text: "Elemente"
|
||||
end
|
||||
|
||||
test 'should create element' do
|
||||
test "should create element" do
|
||||
visit elements_url
|
||||
click_on 'Element hinzufügen'
|
||||
click_on "Element hinzufügen"
|
||||
|
||||
fill_in_rich_text_area 'Details', with: @element.description_html
|
||||
fill_in 'Pfad', with: @element.path
|
||||
fill_in 'Beschreibung', with: @element.title
|
||||
click_on 'Element erstellen'
|
||||
fill_in_rich_text_area "Details", with: @element.description_html
|
||||
fill_in "Pfad", with: @element.path
|
||||
fill_in "Beschreibung", with: @element.title
|
||||
click_on "Element erstellen"
|
||||
end
|
||||
|
||||
test 'should update Element' do
|
||||
test "should update Element" do
|
||||
visit element_url(@element)
|
||||
click_on 'Element bearbeiten', match: :first
|
||||
click_on "Element bearbeiten", match: :first
|
||||
|
||||
fill_in_rich_text_area 'Details', with: @element.description_html
|
||||
fill_in 'Pfad', with: @element.path
|
||||
fill_in 'Beschreibung', with: @element.title
|
||||
click_on 'Element aktualisieren'
|
||||
fill_in_rich_text_area "Details", with: @element.description_html
|
||||
fill_in "Pfad", with: @element.path
|
||||
fill_in "Beschreibung", with: @element.title
|
||||
click_on "Element aktualisieren"
|
||||
end
|
||||
|
||||
test 'should destroy Element' do
|
||||
test "should destroy Element" do
|
||||
visit element_url(@element)
|
||||
click_on 'Element löschen', match: :first
|
||||
click_on "Element löschen", match: :first
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,36 +1,38 @@
|
|||
require 'application_system_test_case'
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "application_system_test_case"
|
||||
|
||||
class LinkCategoriesTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
@link_category = link_categories(:one)
|
||||
end
|
||||
|
||||
test 'visiting the index' do
|
||||
test "visiting the index" do
|
||||
visit link_categories_url
|
||||
assert_selector 'h1', text: 'Linkkategorien'
|
||||
assert_selector "h1", text: "Linkkategorien"
|
||||
end
|
||||
|
||||
test 'should create Linkkategorie' do
|
||||
test "should create Linkkategorie" do
|
||||
visit link_categories_url
|
||||
click_on 'Linkkategorie hinzufügen'
|
||||
click_on "Linkkategorie hinzufügen"
|
||||
|
||||
fill_in_rich_text_area 'Beschreibung', with: @link_category.description_html
|
||||
fill_in 'Name', with: @link_category.name
|
||||
click_on 'Linkkategorie erstellen'
|
||||
fill_in_rich_text_area "Beschreibung", with: @link_category.description_html
|
||||
fill_in "Name", with: @link_category.name
|
||||
click_on "Linkkategorie erstellen"
|
||||
end
|
||||
|
||||
test 'should update Link category' do
|
||||
test "should update Link category" do
|
||||
visit link_category_url(@link_category)
|
||||
click_on 'Linkkategorie bearbeiten', match: :first
|
||||
click_on "Linkkategorie bearbeiten", match: :first
|
||||
|
||||
fill_in_rich_text_area 'Beschreibung', with: @link_category.description_html
|
||||
fill_in 'Name', with: @link_category.name
|
||||
click_on 'Linkkategorie aktualisieren'
|
||||
fill_in_rich_text_area "Beschreibung", with: @link_category.description_html
|
||||
fill_in "Name", with: @link_category.name
|
||||
click_on "Linkkategorie aktualisieren"
|
||||
end
|
||||
|
||||
test 'should destroy Link category' do
|
||||
test "should destroy Link category" do
|
||||
link_category = link_categories(:deletable)
|
||||
visit link_category_url(link_category)
|
||||
click_on 'Linkkategorie löschen', match: :first
|
||||
click_on "Linkkategorie löschen", match: :first
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,37 +1,39 @@
|
|||
require 'application_system_test_case'
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "application_system_test_case"
|
||||
|
||||
class LinksTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
@link = links(:one)
|
||||
end
|
||||
|
||||
test 'visiting the index' do
|
||||
test "visiting the index" do
|
||||
visit links_url
|
||||
assert_selector 'h1', text: 'Links'
|
||||
assert_selector "h1", text: "Links"
|
||||
end
|
||||
|
||||
test 'should create link' do
|
||||
test "should create link" do
|
||||
visit links_url
|
||||
click_on 'Link hinzufügen'
|
||||
click_on "Link hinzufügen"
|
||||
|
||||
select @link.link_category.name, from: 'Kategorie'
|
||||
fill_in 'Linktext', with: @link.text
|
||||
fill_in 'Link', with: @link.url
|
||||
click_on 'Link erstellen'
|
||||
select @link.link_category.name, from: "Kategorie"
|
||||
fill_in "Linktext", with: @link.text
|
||||
fill_in "Link", with: @link.url
|
||||
click_on "Link erstellen"
|
||||
end
|
||||
|
||||
test 'should update Link' do
|
||||
test "should update Link" do
|
||||
visit link_url(@link)
|
||||
click_on 'Link bearbeiten', match: :first
|
||||
click_on "Link bearbeiten", match: :first
|
||||
|
||||
select @link.link_category.name, from: 'Kategorie'
|
||||
fill_in 'Linktext', with: @link.text
|
||||
fill_in 'Link', with: @link.url
|
||||
click_on 'Link aktualisieren'
|
||||
select @link.link_category.name, from: "Kategorie"
|
||||
fill_in "Linktext", with: @link.text
|
||||
fill_in "Link", with: @link.url
|
||||
click_on "Link aktualisieren"
|
||||
end
|
||||
|
||||
test 'should destroy Link' do
|
||||
test "should destroy Link" do
|
||||
visit link_url(@link)
|
||||
click_on 'Link löschen', match: :first
|
||||
click_on "Link löschen", match: :first
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,35 +1,37 @@
|
|||
require 'application_system_test_case'
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "application_system_test_case"
|
||||
|
||||
class ReportsTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
@report = reports(:one)
|
||||
end
|
||||
|
||||
test 'visiting the index' do
|
||||
test "visiting the index" do
|
||||
visit reports_url
|
||||
assert_selector 'h1', text: 'Prüfberichte'
|
||||
assert_selector "h1", text: "Prüfberichte"
|
||||
end
|
||||
|
||||
test 'should create report' do
|
||||
test "should create report" do
|
||||
visit reports_url
|
||||
click_on 'Prüfbericht hinzufügen'
|
||||
click_on "Prüfbericht hinzufügen"
|
||||
|
||||
fill_in_rich_text_area 'Projektbeschreibung', with: @report.comment_html
|
||||
fill_in 'Bezeichnung', with: @report.name
|
||||
click_on 'Prüfbericht erstellen'
|
||||
fill_in_rich_text_area "Projektbeschreibung", with: @report.comment_html
|
||||
fill_in "Bezeichnung", with: @report.name
|
||||
click_on "Prüfbericht erstellen"
|
||||
end
|
||||
|
||||
test 'should update Report' do
|
||||
test "should update Report" do
|
||||
visit report_url(@report)
|
||||
click_on 'Prüfbericht bearbeiten', match: :first
|
||||
click_on "Prüfbericht bearbeiten", match: :first
|
||||
|
||||
fill_in_rich_text_area 'Projektbeschreibung', with: @report.comment_html
|
||||
fill_in 'Bezeichnung', with: @report.name
|
||||
click_on 'Prüfbericht aktualisieren'
|
||||
fill_in_rich_text_area "Projektbeschreibung", with: @report.comment_html
|
||||
fill_in "Bezeichnung", with: @report.name
|
||||
click_on "Prüfbericht aktualisieren"
|
||||
end
|
||||
|
||||
test 'should destroy Report' do
|
||||
test "should destroy Report" do
|
||||
visit report_url(@report)
|
||||
click_on 'Prüfbericht löschen', match: :first
|
||||
click_on "Prüfbericht löschen", match: :first
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,44 +1,46 @@
|
|||
require 'application_system_test_case'
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "application_system_test_case"
|
||||
|
||||
class SuccessCriteriaTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
@success_criterion = success_criteria(:one)
|
||||
end
|
||||
|
||||
test 'visiting the index' do
|
||||
test "visiting the index" do
|
||||
visit success_criteria_url
|
||||
assert_selector 'h1', text: 'Erfolgskriterien'
|
||||
assert_selector "h1", text: "Erfolgskriterien"
|
||||
end
|
||||
|
||||
test 'should create Erfolgskriterium' do
|
||||
test "should create Erfolgskriterium" do
|
||||
visit success_criteria_url
|
||||
click_on 'Erfolgskriterium hinzufügen'
|
||||
click_on "Erfolgskriterium hinzufügen"
|
||||
|
||||
fill_in_rich_text_area 'Testkommentar', with: @success_criterion.comment_html
|
||||
fill_in_rich_text_area 'Richtlinie', with: @success_criterion.description_html
|
||||
fill_in_rich_text_area "Testkommentar", with: @success_criterion.comment_html
|
||||
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
|
||||
# fill_in 'Result', with: @success_criterion.result
|
||||
# fill_in 'Title', with: @success_criterion.title
|
||||
click_on 'Erfolgskriterium erstellen'
|
||||
click_on "Erfolgskriterium erstellen"
|
||||
end
|
||||
|
||||
test 'should update Erfolgskriterium' do
|
||||
test "should update Erfolgskriterium" do
|
||||
visit success_criterion_url(@success_criterion)
|
||||
click_on 'Erfolgskriterium bearbeiten', match: :first
|
||||
click_on "Erfolgskriterium bearbeiten", match: :first
|
||||
|
||||
fill_in_rich_text_area 'Testkommentar', with: @success_criterion.comment_html
|
||||
fill_in_rich_text_area 'Richtlinie', with: @success_criterion.description_html
|
||||
find('label', text: 'Bestanden', visible: true).click
|
||||
fill_in 'Titel', with: 'new'
|
||||
click_on 'Erfolgskriterium aktualisieren'
|
||||
fill_in_rich_text_area "Testkommentar", with: @success_criterion.comment_html
|
||||
fill_in_rich_text_area "Richtlinie", with: @success_criterion.description_html
|
||||
find("label", text: "Bestanden", visible: true).click
|
||||
fill_in "Titel", with: "new"
|
||||
click_on "Erfolgskriterium aktualisieren"
|
||||
|
||||
# assert_text 'Erfolgskriterium was successfully updated'
|
||||
# click_on 'Back'
|
||||
end
|
||||
|
||||
test 'should destroy Erfolgskriterium' do
|
||||
test "should destroy Erfolgskriterium" do
|
||||
visit success_criterion_url(@success_criterion)
|
||||
click_on 'Erfolgskriterium löschen', match: :first
|
||||
click_on "Erfolgskriterium löschen", match: :first
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
ENV['RAILS_ENV'] ||= 'test'
|
||||
require_relative '../config/environment'
|
||||
require 'rails/test_help'
|
||||
require 'action_text/system_test_helper'
|
||||
ENV["RAILS_ENV"] ||= "test"
|
||||
require_relative "../config/environment"
|
||||
require "rails/test_help"
|
||||
require "action_text/system_test_helper"
|
||||
|
||||
module ActiveSupport
|
||||
class TestCase
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue