Commit f9c0c98b authored by Chrysanthi Lagodimou's avatar Chrysanthi Lagodimou

Add filter on bestaetigt on spv index

parent 7c492b1c
......@@ -7,12 +7,15 @@ nav.navbar.section-navigation
- if @semester_process
li= button_link 'Semester Prozess bearbeiten', edit_semester_process_path(@semester_process), dimension: 'sm'
= custom_filter_dropdown('Bestätigt',
{ q: :commited_by_id_null, text: 'Unbestätigt', value: 'true' },
{ q: :commited_by_id_not_null, text: 'Bestätigt', value: 'true'})
= custom_filter_dropdown('Übernommen',
{ q: :responsible_id_null, text: 'Offen', value: 'true' },
{ q: :responsible_id_not_null, text: 'Übernommen', value: 'true' },
*@responsibles)
{ q: :responsible_id_null, text: 'Offen', value: 'true' },
{ q: :responsible_id_not_null, text: 'Übernommen', value: 'true' },
*@responsibles)
= custom_filter_dropdown('Quittiert',
{ q: :reviewed_by_id_null, text: 'Unquittiert', value: 'true' },
{ q: :reviewed_by_id_not_null, text: 'Quittiert', value: 'true' },
*@reviewers)
{ q: :reviewed_by_id_null, text: 'Unquittiert', value: 'true' },
{ q: :reviewed_by_id_not_null, text: 'Quittiert', value: 'true' },
*@reviewers)
hr
......@@ -10,7 +10,6 @@ h1= t_title(:index)
tr
th.hidden-print Aktionen
th.limit-width Journal / Stunden
th Status
th.limit-width Freiwilige/r
th Einsätze
th Ziele
......@@ -32,11 +31,6 @@ h1= t_title(:index)
= button_link icon_span(:journal_new), new_volunteer_journal_path(spv.volunteer,
semester_feedback_id: spv.semester_feedbacks.ids), title: 'Neuen Journal eintrag mit Zitat erstellen'
= button_link icon_span(:hours), volunteer_hours_path(spv.volunteer), title: 'Stunden'
td
- if spv.commited_at.present?
.label.label-success Bestätigt
- else
.label.label-warning Unbestätigt
td= link_to_if policy(Volunteer).edit?, spv.volunteer.contact.full_name, edit_volunteer_path(spv.volunteer)
td= render_missions(spv)
= td_truncate_content_modal(spv.render_feedback(:goals), 'Ziele', shorten_size: 300)
......
......@@ -30,14 +30,17 @@ class SemesterProcessVolunteerActionsTest < ApplicationSystemTestCase
# Offen/open -> @spv1
# Übernommen/Quittiert from superadmin2
# Bestätigt from volunteer 2
@volunteer2 = create :volunteer_with_user
@volunteer2.contact.update(first_name: 'volunteer2', last_name: 'volunteer2')
@spv2 = create(:semester_process_volunteer, :with_mission, volunteer: @volunteer2,
semester_process: @semester_process)
@superadmin2 = create :user
@spv2.update(responsible: @superadmin2, reviewed_by: @superadmin2, reviewed_at: Time.zone.now)
@spv2.update(responsible: @superadmin2, reviewed_by: @superadmin2, reviewed_at: Time.zone.now,
commited_by: @volunteer2.user)
# Übernommen/Quittiert from superadmin3
# Unbestätigt
@volunteer3 = create :volunteer_with_user
@volunteer3.contact.update(first_name: 'volunteer3', last_name: 'volunteer3')
@spv3 = create(:semester_process_volunteer, :with_mission, volunteer: @volunteer3,
......@@ -172,4 +175,43 @@ class SemesterProcessVolunteerActionsTest < ApplicationSystemTestCase
assert_not page.has_text? "Quittiert von #{@superadmin3.email}"\
" am #{I18n.l(@spv3.reviewed_at.to_date)}"
end
test 'bestätigt for semester process volunteer index works' do
filters_setup
# filter for Alle/all (Bestätigt)
within page.find_all('nav.section-navigation').last do
click_link 'Bestätigt'
click_link 'Alle'
end
visit current_url
within 'tbody' do
assert page.has_text? @volunteer.contact.full_name, count: 1
assert page.has_text? @volunteer2.contact.full_name, count: 2
assert page.has_text? @volunteer3.contact.full_name, count: 1
end
# filter for Unbestätigt
within page.find_all('nav.section-navigation').last do
click_link 'Bestätigt'
click_link 'Unbestätigt'
end
visit current_url
within 'tbody' do
assert page.has_text? @volunteer.contact.full_name, count: 1
assert_not page.has_text? @volunteer2.contact.full_name
assert page.has_text? @volunteer3.contact.full_name, count: 1
end
# filter for Bestätigt
click_link 'Bestätigt: Unbestätigt', match: :first
within 'li.dropdown.open' do
click_link 'Bestätigt'
end
visit current_url
within 'tbody' do
assert_not page.has_text? @volunteer.contact.full_name
assert page.has_text? @volunteer2.contact.full_name, count: 2
assert_not page.has_text? @volunteer3.contact.full_name
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment