general system test speedup by reducing waiting time on refute content shown on page

parent b4931ca3
......@@ -49,22 +49,38 @@ Metrics/BlockLength:
- define # for FactoryBot
- factory
Lint/RaiseException:
Enabled: true
Lint/StructNewOverride:
Enabled: true
Layout/FirstArrayElementIndentation:
Enabled: true
EnforcedStyle: consistent
Layout/FirstHashElementIndentation:
Enabled: true
EnforcedStyle: consistent
Layout/FirstParameterIndentation:
Enabled: true
EnforcedStyle: consistent
Layout/HashAlignment:
EnforcedLastArgumentHashStyle: ignore_implicit
EnforcedLastArgumentHashStyle: always_inspect
Layout/MultilineMethodCallIndentation:
Enabled: true
EnforcedStyle: indented
Layout/MultilineOperationIndentation:
Enabled: true
EnforcedStyle: indented
Layout/ParameterAlignment:
EnforcedStyle: with_fixed_indentation
Enabled: true
EnforcedStyle: with_first_parameter
Layout/ArgumentAlignment:
Enabled: true
EnforcedStyle: with_first_argument
Layout/SpaceAroundMethodCallOperator:
Enabled: true
Layout/EmptyLinesAroundAttributeAccessor:
Enabled: true
Layout/LineLength:
Max: 100
# To make it possible to copy or click on URIs in the code, we allow lines
......@@ -119,3 +135,5 @@ Style/HashEachMethods:
Enabled: true
Style/ExponentialNotation:
Enabled: true
Style/SlicingWithRange:
Enabled: true
h1.m-b-20 Profil von #{@user.full_name}
.row
.col-md-4
strong= t_attr(:email)
......
......@@ -12,7 +12,7 @@ class AssignmentFiltersTest < ApplicationSystemTestCase
test 'filter by activity' do
within 'tbody' do
assert_text 'Aktiv'
refute_text 'Inaktiv'
refute_text 'Inaktiv', wait: 0
end
within '.section-navigation' do
......@@ -31,8 +31,8 @@ class AssignmentFiltersTest < ApplicationSystemTestCase
end
within 'tbody' do
refute_text 'Aktiv'
assert_text 'Inaktiv'
refute_text 'Aktiv', wait: 0
end
end
end
......@@ -42,7 +42,7 @@ class AssignmentSearchesTest < ApplicationSystemTestCase
visit current_url
assert_text @assignment1.volunteer.contact.full_name
assert_text @assignment3.volunteer.contact.full_name
refute_text @assignment2.volunteer.contact.full_name
refute_text @assignment2.volunteer.contact.full_name, wait: 0
end
test 'enter_volunteer_search_text_brings_suggestions' do
......@@ -73,7 +73,7 @@ class AssignmentSearchesTest < ApplicationSystemTestCase
visit current_url
assert_text @assignment2.client.contact.full_name
assert_text @assignment3.client.contact.full_name
refute_text @assignment1.client.contact.full_name
refute_text @assignment1.client.contact.full_name, wait: 0
end
test 'enter_client_search_text_brings_suggestions' do
......
......@@ -29,8 +29,8 @@ class AssignmentTerminationIndexTest < ApplicationSystemTestCase
click_link 'Beendete Begleitungen'
assert_text termination_index_table_text(@un_submitted)
assert_text termination_index_table_text(@submitted)
refute_text termination_index_table_text(@not_ended)
refute_text termination_index_table_text(@verified)
refute_text termination_index_table_text(@not_ended), wait: 0
refute_text termination_index_table_text(@verified), wait: 0
end
test 'client with no active assignments can be terminated' do
......@@ -45,7 +45,7 @@ class AssignmentTerminationIndexTest < ApplicationSystemTestCase
click_link 'Beendete Begleitungen'
assert_text termination_index_table_text(assignment1)
refute_text termination_index_table_text(assignment2)
refute_text termination_index_table_text(assignment2), wait: 0
click_link 'Klient/in beenden'
......@@ -54,7 +54,7 @@ class AssignmentTerminationIndexTest < ApplicationSystemTestCase
assert page.has_link? 'Klient/in beenden'
assignment2.update(period_end: 4.days.ago, period_end_set_by: @superadmin)
visit current_url
assert_text termination_index_table_text(assignment1)
......@@ -62,8 +62,8 @@ class AssignmentTerminationIndexTest < ApplicationSystemTestCase
click_link 'Klient/in beenden', match: :first
refute page.has_link? 'Klient/in beenden'
assert_text 'Klient/in wurde erfolgreich beendet.'
refute page.has_link? 'Klient/in beenden', wait: 0
assert client.reload.resigned?
end
......@@ -72,8 +72,8 @@ class AssignmentTerminationIndexTest < ApplicationSystemTestCase
click_link 'Ende Bestätigt'
click_link exact_text: 'Bestätigt'
visit current_url
refute_text termination_index_table_text(@un_submitted)
assert_text termination_index_table_text(@submitted)
refute_text termination_index_table_text(@un_submitted), wait: 0
end
test 'filtering_not_submitted_terminations' do
......@@ -90,9 +90,9 @@ class AssignmentTerminationIndexTest < ApplicationSystemTestCase
click_link 'Quittiert: Unquittiert'
click_link exact_text: 'Quittiert'
visit current_url
refute_text termination_index_table_text(@un_submitted)
refute_text termination_index_table_text(@submitted)
assert_text termination_index_table_text(@verified)
refute_text termination_index_table_text(@un_submitted), wait: 0
refute_text termination_index_table_text(@submitted), wait: 0
end
test 'ended_assignment_can_be_verified' do
......@@ -119,16 +119,16 @@ class AssignmentTerminationIndexTest < ApplicationSystemTestCase
click_link 'Ende Bestätigt'
click_link exact_text: 'Bestätigt'
refute_text termination_index_table_text(@un_submitted)
refute_text termination_index_table_text(@submitted)
refute_text termination_index_table_text(@not_ended)
assert_text termination_index_table_text(@verified)
refute_text termination_index_table_text(@un_submitted), wait: 0
refute_text termination_index_table_text(@submitted), wait: 0
refute_text termination_index_table_text(@not_ended), wait: 0
click_link 'Filter aufheben'
assert_text termination_index_table_text(@un_submitted)
assert_text termination_index_table_text(@submitted)
refute_text termination_index_table_text(@not_ended)
refute_text termination_index_table_text(@not_ended), wait: 0
assert_text termination_index_table_text(@verified)
end
......@@ -140,10 +140,10 @@ class AssignmentTerminationIndexTest < ApplicationSystemTestCase
test 'there_is_correct_links_to_creating_certificates' do
visit terminated_index_assignments_path
refute page.has_link? 'Dossier Freiwillig Engagiert erstellen',
href: /\/volunteers\/#{@un_submitted.volunteer.id}\/certificates\/new/
assert page.has_link? 'Dossier Freiwillig Engagiert erstellen',
href: /\/volunteers\/#{@submitted.volunteer.id}\/certificates\/new/
refute page.has_link? 'Dossier Freiwillig Engagiert erstellen',
href: /\/volunteers\/#{@un_submitted.volunteer.id}\/certificates\/new/, wait: 0
end
test 'assignment_quittieren_creates_a_assignment_log_record_from_assignment' do
......
......@@ -124,10 +124,11 @@ class AssignmentsTest < ApplicationSystemTestCase
login_as @volunteer.user
visit volunteer_path(@volunteer)
refute_link 'Begleitung erfassen'
assert page.has_css?('.assignments-table') # only to allow refute expectations to wait 0
refute_link 'Begleitung erfassen', wait: 0
within '.assignments-table, .group-assignments-table' do
refute_link 'Bearbeiten'
refute_link 'Bearbeiten', wait: 0
end
end
......@@ -160,8 +161,9 @@ class AssignmentsTest < ApplicationSystemTestCase
login_as social_worker
visit client_path(another_assignment.client)
refute page.has_link? 'Anzeigen'
refute page.has_link? 'Herunterladen'
assert_text another_assignment.client.contact.full_name # only to allow refute expectations to wait 0
refute page.has_link? 'Anzeigen', wait: 0
refute page.has_link? 'Herunterladen', wait: 0
visit client_path(client)
assert page.has_link? 'Anzeigen'
......@@ -200,7 +202,8 @@ class AssignmentsTest < ApplicationSystemTestCase
login_as @user
visit assignments_path
refute_link 'Herunterladen'
assert_text 'Begleitungen' # only to allow refute expectations to wait 0
refute_link 'Herunterladen', wait: 0
# create initial PDF
......
......@@ -44,15 +44,15 @@ class BillingExpensesTest < ApplicationSystemTestCase
assert_link 'Herunterladen', count: 1
assert_text "#{@volunteer1} UBS, #{@volunteer1.iban} 3.5 Stunden Fr. 50.00"
refute_text @volunteer2, wait: 1
refute_text @volunteer3, wait: 1
refute_text @volunteer4, wait: 1
refute_text @volunteer2, wait: 0
refute_text @volunteer3, wait: 0
refute_text @volunteer4, wait: 0
click_link 'Semester: 1. Semester 2018'
click_link '2. Semester 2017'
assert_text "#{@volunteer4} #{@volunteer4.iban} 5.5 Stunden Fr. 50.00"
refute_text @volunteer1, wait: 1
refute_text @volunteer1, wait: 0
click_link 'Semester: 2. Semester 2017'
click_link 'Alle'
......@@ -69,7 +69,7 @@ class BillingExpensesTest < ApplicationSystemTestCase
assert_text "#{@volunteer1} UBS, #{@volunteer1.iban} 37.5 Stunden Fr. 100.00"
assert_text "#{@volunteer2} #{@volunteer2.iban} 4.5 Stunden Fr. 50.00"
assert_text "#{@volunteer3} Keine IBAN angegeben 2.5 Stunden Fr. 50.00"
refute_text @volunteer4, wait: 1
refute_text @volunteer4, wait: 0
check 'table-row-select-all'
......@@ -83,14 +83,14 @@ class BillingExpensesTest < ApplicationSystemTestCase
assert_text 'Spesenformulare wurden erfolgreich erstellt.'
assert_text "#{@volunteer1} UBS, #{@volunteer1.iban} 37.5 Stunden Fr. 100.00"
assert_text "#{@volunteer2} #{@volunteer2.iban} 4.5 Stunden Fr. 50.00"
refute_text @volunteer3, wait: 1
refute_text @volunteer3, wait: 0
create :hour, volunteer: @volunteer1, hourable: @assignment1, hours: 1.5, meeting_date: @date
click_link 'Spesenformulare erfassen'
refute_text @volunteer1, wait: 1
refute_text @volunteer2, wait: 1
refute_text @volunteer1, wait: 0
refute_text @volunteer2, wait: 0
assert_text "#{@volunteer3} Keine IBAN angegeben 2.5 Stunden Fr. 50.00"
refute_text @volunteer4, wait: 1
refute_text @volunteer4, wait: 0
end
test 'new_billing_expense_respects_the_semester_filter' do
......@@ -111,7 +111,7 @@ class BillingExpensesTest < ApplicationSystemTestCase
click_link 'Spesenformulare erfassen'
assert_text "#{volunteer2} #{volunteer2.iban} 26 Stunden Fr. 100.00 1. Semester 2018"
assert_text "#{volunteer3} #{volunteer3.iban} 3 Stunden Fr. 50.00 1. Semester 2018"
refute_text volunteer1, wait: 1
refute_text volunteer1, wait: 0
visit billing_expenses_path
......@@ -120,7 +120,7 @@ class BillingExpensesTest < ApplicationSystemTestCase
click_link 'Spesenformulare erfassen'
assert_text "#{volunteer1} #{volunteer1.iban} 26 Stunden Fr. 100.00 2. Semester 2017"
assert_text "#{volunteer2} #{volunteer2.iban} 15 Stunden Fr. 50.00 2. Semester 2017"
refute_text volunteer3, wait: 1
refute_text volunteer3, wait: 0
end
test 'creating_a_billing_expense_should_respect_semester_filter' do
......@@ -170,7 +170,7 @@ class BillingExpensesTest < ApplicationSystemTestCase
assert_text "Spesenformulare für #{@volunteer1}"
assert_text "UBS, #{@volunteer1.iban} 3.5 Stunden Fr. 50.00"
refute_text @volunteer4, wait: 1
refute_text @volunteer4, wait: 0
assert_link 'Zurück', href: volunteer_path(@volunteer1)
end
......@@ -205,7 +205,7 @@ class BillingExpensesTest < ApplicationSystemTestCase
end
assert_text 'Spesenformular wurde erfolgreich gelöscht.'
refute_text @billing_expense1.volunteer, wait: 1
refute_text @billing_expense1.volunteer, wait: 0
end
test 'download_single_billing_expense' do
......
......@@ -11,7 +11,8 @@ class CertificatesTest < ApplicationSystemTestCase
test 'volunteer_user_cannot_see_create_certificate_button' do
login_as @volunteer.user
visit volunteer_path(@volunteer)
refute page.has_link? 'Nachweis ausstellen'
assert_text @volunteer.contact.full_name # only to allow refute expectations to wait 0
refute page.has_link? 'Nachweis ausstellen', wait: 0
end
test 'creating_volunteer_certificate_form_has_right_content_prefilled' do
......
......@@ -18,8 +18,8 @@ class ClientNotificationsTest < ApplicationSystemTestCase
within 'tr.bg-success' do
assert page.has_text? @client_notification.body
assert page.has_selector?('table > tbody td:nth-child(2) span.glyphicon-ok')
refute page.has_text? @other_client_notification.body
refute page.has_selector?('table > tbody td:nth-child(2) span.glyphicon-remove')
refute page.has_text? @other_client_notification.body, wait: 0
refute page.has_selector?('table > tbody td:nth-child(2) span.glyphicon-remove'), wait: 0
end
end
......@@ -33,8 +33,8 @@ class ClientNotificationsTest < ApplicationSystemTestCase
page.check('client_notification_active')
click_button 'Klienten Wartezeit Benachrichtigung aktualisieren'
within 'tr.bg-success' do
refute page.has_text? @client_notification.body
assert page.has_text? @other_client_notification.body
refute page.has_text? @client_notification.body, wait: 0
end
end
......@@ -83,7 +83,8 @@ class ClientNotificationsTest < ApplicationSystemTestCase
login_as @social_worker
visit clients_path
refute page.has_link? 'Wartezeitbenachrichtigung'
assert_text 'Klient/innen' # only to allow refute expectations to wait 0
refute page.has_link? 'Wartezeitbenachrichtigung', wait: 0
end
test 'superadmin does not see this notification' do
......@@ -104,6 +105,6 @@ class ClientNotificationsTest < ApplicationSystemTestCase
end
click_button 'Klient/in erfassen', match: :first
assert page.has_text? 'Klient/in wurde erfolgreich erstellt.'
refute page.has_text? @client_notification.body
refute page.has_text? @client_notification.body, wait: 0
end
end
......@@ -30,8 +30,8 @@ class ClientsFilterDropdownsTest < ApplicationSystemTestCase
within 'tbody' do
assert_text @accepted_woman_age_old
assert_text @accepted_no_matter_age_old
refute_text @resigned_woman_age_middle
refute_text @rejected_no_matter_age_middle
refute_text @resigned_woman_age_middle, wait: 0
refute_text @rejected_no_matter_age_middle, wait: 0
end
within '.section-navigation' do
click_link 'Prozess: Angemeldet'
......@@ -59,10 +59,10 @@ class ClientsFilterDropdownsTest < ApplicationSystemTestCase
end
visit current_url
within 'tbody' do
refute_text @accepted_woman_age_old
assert_text @accepted_no_matter_age_old
refute_text @resigned_woman_age_middle
refute_text @rejected_no_matter_age_middle
refute_text @accepted_woman_age_old, wait: 0
refute_text @resigned_woman_age_middle, wait: 0
refute_text @rejected_no_matter_age_middle, wait: 0
end
within '.section-navigation' do
click_link 'Anrede: Herr'
......@@ -73,8 +73,8 @@ class ClientsFilterDropdownsTest < ApplicationSystemTestCase
within 'tbody' do
assert_text @accepted_woman_age_old
assert_text @accepted_no_matter_age_old
refute_text @resigned_woman_age_middle
refute_text @rejected_no_matter_age_middle
refute_text @resigned_woman_age_middle, wait: 0
refute_text @rejected_no_matter_age_middle, wait: 0
end
click_link 'Filter aufheben'
visit current_url
......@@ -104,9 +104,9 @@ class ClientsFilterDropdownsTest < ApplicationSystemTestCase
visit current_url
within 'tbody' do
assert_text @accepted_woman_age_old
refute_text @accepted_no_matter_age_old
refute_text @resigned_woman_age_middle
refute_text @rejected_no_matter_age_middle
refute_text @accepted_no_matter_age_old, wait: 0
refute_text @resigned_woman_age_middle, wait: 0
refute_text @rejected_no_matter_age_middle, wait: 0
end
within '.section-navigation' do
click_link 'Anrede: Frau'
......@@ -117,8 +117,8 @@ class ClientsFilterDropdownsTest < ApplicationSystemTestCase
within 'tbody' do
assert_text @accepted_woman_age_old
assert_text @accepted_no_matter_age_old
refute_text @resigned_woman_age_middle
refute_text @rejected_no_matter_age_middle
refute_text @resigned_woman_age_middle, wait: 0
refute_text @rejected_no_matter_age_middle, wait: 0
end
click_link 'Filter aufheben'
visit current_url
......@@ -148,8 +148,8 @@ class ClientsFilterDropdownsTest < ApplicationSystemTestCase
assert_text client_with_language_skills
assert_text @accepted_woman_age_old
assert_text @accepted_no_matter_age_old
refute_text @resigned_woman_age_middle
refute_text @rejected_no_matter_age_middle
refute_text @resigned_woman_age_middle, wait: 0
refute_text @rejected_no_matter_age_middle, wait: 0
click_on 'Geschlecht Freiwillige/r: Alle'
click_on 'Frau'
......@@ -157,26 +157,26 @@ class ClientsFilterDropdownsTest < ApplicationSystemTestCase
assert_text client_with_language_skills
assert_text @accepted_woman_age_old
assert_text @accepted_no_matter_age_old
refute_text @resigned_woman_age_middle
refute_text @rejected_no_matter_age_middle
refute_text @resigned_woman_age_middle, wait: 0
refute_text @rejected_no_matter_age_middle, wait: 0
click_on 'Alter Freiwillige/r: Alle'
click_on '20 - 35'
assert_text client_with_language_skills
refute_text @accepted_woman_age_old
refute_text @accepted_no_matter_age_old
refute_text @resigned_woman_age_middle
refute_text @rejected_no_matter_age_middle
refute_text @accepted_woman_age_old, wait: 0
refute_text @accepted_no_matter_age_old, wait: 0
refute_text @resigned_woman_age_middle, wait: 0
refute_text @rejected_no_matter_age_middle, wait: 0
click_on 'Sprachkenntnisse: Alle'
click_on client_with_language_skills.language_skills.first.language_name, match: :first
wait_for_ajax
assert_text client_with_language_skills
refute_text @accepted_woman_age_old
refute_text @accepted_no_matter_age_old
refute_text @resigned_woman_age_middle
refute_text @rejected_no_matter_age_middle
refute_text @accepted_woman_age_old, wait: 0
refute_text @accepted_no_matter_age_old, wait: 0
refute_text @resigned_woman_age_middle, wait: 0
refute_text @rejected_no_matter_age_middle, wait: 0
end
test 'filter find client availability' do
......@@ -202,15 +202,15 @@ class ClientsFilterDropdownsTest < ApplicationSystemTestCase
assert_text client_flexible
assert_text client_flexible_morning
refute_text client_morning
refute_text client_morning, wait: 0
# boolean_filter_dropdown chooses two values -> flexible & mornings
click_on 'Verfügbarkeit'
click_on 'Morgens'
assert_text client_flexible_morning
refute_text client_flexible
refute_text client_morning
refute_text client_flexible, wait: 0
refute_text client_morning, wait: 0
# deselect flexible
click_on 'Verfügbarkeit'
......@@ -218,6 +218,6 @@ class ClientsFilterDropdownsTest < ApplicationSystemTestCase
assert_text client_morning
assert_text client_flexible_morning
refute_text client_flexible
refute_text client_flexible, wait: 0
end
end
......@@ -76,7 +76,7 @@ class ClientsTest < ApplicationSystemTestCase
end
click_button 'Klient/in erfassen', match: :first
assert_text 'Klient/in wurde erfolgreich erstellt.'
refute_select 'Beendet'
refute_select 'Beendet', wait: 0
assert_select 'Geschlecht Freiwillige/r', selected: 'egal'
assert_select 'Alter Freiwillige/r', selected: 'egal'
......@@ -181,19 +181,19 @@ class ClientsTest < ApplicationSystemTestCase
login_as @department_manager
visit clients_path
assert_text client_department_manager
refute_text client_social_worker
refute_text client
refute_text client_social_worker, wait: 0
refute_text client, wait: 0
assert page.has_link? 'Anzeigen'
assert page.has_link? 'Bearbeiten', href: edit_client_path(client_department_manager)
refute page.has_link? 'Bearbeiten', href: edit_client_path(client_social_worker)
refute page.has_link? 'Bearbeiten', href: edit_client_path(client_social_worker), wait: 0
login_as social_worker
visit clients_path
assert_text client_social_worker
refute_text client_department_manager
refute_text client
refute_text client_department_manager, wait: 0
refute_text client, wait: 0
assert page.has_link? 'Anzeigen'
refute page.has_link? 'Bearbeiten', href: edit_client_path(client_department_manager)
refute page.has_link? 'Bearbeiten', href: edit_client_path(client_department_manager), wait: 0
assert page.has_link? 'Bearbeiten', href: edit_client_path(client_social_worker)
end
......@@ -217,7 +217,7 @@ class ClientsTest < ApplicationSystemTestCase
assert_text 'assigned_goals assigned_interests assigned_authority ' +
I18n.l(with_assignment.created_at.to_date)
refute_text superadmins_client.contact.full_name
refute_text superadmins_client.contact.full_name, wait: 1
end
test 'client_index_shows_german_and_native_languages_only' do
......@@ -230,7 +230,7 @@ class ClientsTest < ApplicationSystemTestCase
visit clients_path
assert_text 'Deutsch, Gut'
assert_text 'Italienisch, Muttersprache'
refute_text 'Französisch, Mittel'
refute_text 'Französisch, Mittel', wait: 0
end
test 'new_client_form_has_german_with_its_non_native_speaker_abilities' do
......@@ -288,7 +288,7 @@ class ClientsTest < ApplicationSystemTestCase
fill_in 'Strasse', with: 'Sihlstrasse 131'
fill_in 'PLZ', with: '8002'
fill_in 'Ort', with: 'Zürich'
refute page.has_select? 'Fallführende Stelle'
refute page.has_select? 'Fallführende Stelle', wait: 0
click_button 'Klient/in erfassen', match: :first
......@@ -335,9 +335,7 @@ class ClientsTest < ApplicationSystemTestCase
page.accept_confirm do
click_link 'Löschen'
end
refute page.has_link? 'Löschen'
refute page.has_text? client
refute page.has_css? client_css
assert_text 'Klient/in wurde erfolgreich gelöscht.'
end
end
......@@ -350,8 +348,8 @@ class ClientsTest < ApplicationSystemTestCase
visit clients_path
within client_css do
refute page.has_link? 'Löschen'
assert page.has_text? client
refute page.has_link? 'Löschen', wait: 0
end
end
end
......@@ -367,8 +365,8 @@ class ClientsTest < ApplicationSystemTestCase
visit clients_path
within client_css do
refute page.has_link? 'Löschen'
assert page.has_text? client
refute page.has_link? 'Löschen', wait: 0
end
end
end
......
......@@ -8,12 +8,14 @@ class DepartmentManagerTest < ApplicationSystemTestCase
test 'when updates user login, cannot see role field' do
visit edit_user_path(@department_manager)
assert_not page.has_field? 'Role'
assert_text 'Login bearbeiten' # only to allow refute expectations to wait 0
assert_not page.has_field? 'Role', wait: 0
end
test 'does not have navbar links to users' do
visit user_path(@department_manager.id)
assert_not page.has_link? 'Benutzer/innen'
assert_text "Profil von #{@department_manager.full_name}"
assert_not page.has_link? 'Benutzer/innen', wait: 0
end
test 'has a navbar link to clients page' do
......@@ -49,7 +51,7 @@ class DepartmentManagerTest < ApplicationSystemTestCase
visit group_offers_path
assert page.has_text? group_offer.title
refute page.has_field? 'Bezeichnung', with: 'new title'
refute page.has_field? 'Bezeichnung', with: 'new title', wait: 0
end
test 'can edit group_offers in her department' do
......@@ -73,11 +75,11 @@ class DepartmentManagerTest < ApplicationSystemTestCase
visit group_offers_path
assert page.has_text? group_offer.title
refute page.has_field? 'Bezeichnung', with: 'new title'
refute page.has_field? 'Bezeichnung', with: 'new title', wait: 0
visit group_offer_path group_offer
assert page.has_text? group_offer.title
refute page.has_button? 'Gruppenangebot aktualisieren'
refute page.has_button? 'Gruppenangebot aktualisieren', wait: 0
visit edit_group_offer_path group_offer
assert page.has_text? I18n.t('not_authorized')
......@@ -104,9 +106,9 @@ class DepartmentManagerTest < ApplicationSystemTestCase
end
assert page.has_link? 'Anzeigen'
refute page.has_link? 'Bearbeiten'
refute page.has_link? 'Beendigungsformular'
refute page.has_link? 'Freiwillige/n beenden'
refute page.has_link? 'Bearbeiten', wait: 0
refute page.has_link? 'Beendigungsformular', wait: 0
refute page.has_link? 'Freiwillige/n beenden', wait: 0
visit group_offer_path group_offer
within '.table-responsive.assignments-table' do
......@@ -117,13 +119,13 @@ class DepartmentManagerTest < ApplicationSystemTestCase
assert page.has_text? group_offer.title
assert page.has_link? 'Anzeigen'
refute page.has_link? 'Bearbeiten'
refute page.has_link? 'Bearbeiten', wait: 0
visit group_offer_path group_offer
assert page.has_text? group_offer.title
refute page.has_button? 'Gruppenangebot aktualisieren'
refute page.has_button? 'Gruppenangebot aktualisieren', wait: 0
within '.table-responsive.assignments-table' do
refute page.has_link? 'Bearbeiten'
refute page.has_link? 'Bearbeiten', wait: 0
end
visit edit_group_offer_path group_offer
......@@ -178,13 +180,14 @@ class DepartmentManagerTest < ApplicationSystemTestCase
end
assert page.has_link? 'Anzeigen'
refute page.has_link? 'Bearbeiten'
refute page.has_link? 'Beendigungsformular'
refute page.has_link? 'Freiwillige/n beenden'
refute page.has_link? 'Bearbeiten', wait: 0
refute page.has_link? 'Beendigungsformular', wait: 0
refute page.has_link? 'Freiwillige/n beenden', wait: 0
visit group_offer_path group_offer
assert page.has_css? '.table-responsive.assignments-table' # only here to avoid waiting with refute
within '.table-responsive.assignments-table' do
refute page.has_link? 'Bearbeiten'
refute page.has_link? 'Bearbeiten', wait: 0
end
visit group_offers_path
......@@ -195,16 +198,17 @@ class DepartmentManagerTest < ApplicationSystemTestCase
visit group_offer_path group_offer
assert page.has_text? group_offer.title
refute page.has_button? 'Gruppenangebot aktualisieren'
refute page.has_button? 'Gruppenangebot aktualisieren', wait: 0
within '.table-responsive.assignments-table' do
refute page.has_link? 'Bearbeiten'
refute page.has_link? 'Bearbeiten', wait: 0
end
visit edit_group_offer_path group_offer
assert page.has_text? I18n.t('not_authorized')
visit new_group_offer_path
refute page.has_text? I18n.t('not_authorized')
assert_text 'Gruppenangebot erfassen' # only here to avoid waiting with refute
refute page.has_text? I18n.t('not_authorized'), wait: 0
visit edit_group_assignment_path group_assignment
assert page.has_text? I18n.t('not_authorized')
......@@ -220,8 +224,8 @@ class DepartmentManagerTest < ApplicationSystemTestCase
visit volunteer_path(volunteer)
assert page.has_link? group_offer.title
assert page.has_link? assignment.client.contact.full_name
refute page.has_link? 'Löschen'
refute page.has_link? 'Feedback erfassen'
refute page.has_link? 'Feedback Liste'
refute page.has_link? 'Löschen', wait: 0
refute page.has_link? 'Feedback erfassen', wait: 0
refute page.has_link? 'Feedback Liste', wait: 0
end
end
......@@ -20,7 +20,8 @@ class DepartmentsTest < ApplicationSystemTestCase
test 'other users should not see departments link in navigation' do
login_as @social_worker
visit root_path
refute page.has_link? 'Standorte'
assert_text 'Klient/innen'
refute page.has_link? 'Standorte', wait: 0
end
test 'superadmin can see all departments in departments_path' do
......@@ -78,7 +79,6 @@ class DepartmentsTest < ApplicationSystemTestCase
test "Department Managers can update their department's fields" do
login_as @department_manager
visit edit_department_path(@department_manager.department.first.id)
refute page.has_select? 'User'
fill_in 'Name', with: 'Name changed'
fill_in 'Strasse', with: 'Street changed'
fill_in 'Adresszusatz', with: 'Extended address changed'
......@@ -86,6 +86,7 @@ class DepartmentsTest < ApplicationSystemTestCase
fill_in 'Ort', with: 'City changed'
fill_in 'Mailadresse', with: 'department@aoz.ch'