Commit d62c54fa authored by Tugce Nur Tas's avatar Tugce Nur Tas
Browse files

remove seeking clients button for external volunteer and add system test

parent aab9a637
Pipeline #18749 passed with stage
in 36 minutes and 44 seconds
......@@ -12,7 +12,7 @@ nav.navbar.section-navigation
- if @volunteer.internal_and_started_assignments?
li = button_link navigation_glyph(:hours), volunteer_hours_path(@volunteer), title: t('volunteer_applications.show.hour_reports')
- if policy(Volunteer).superadmin_privileges?
- if @volunteer.seeking_clients?
- if @volunteer.seeking_clients? && !@volunteer.external
li= button_link navigation_glyph(:assignment), find_client_volunteer_path(id: @volunteer), title: t('seeking_clients')
- if @volunteer.internal_and_started_assignments?
li= button_link navigation_glyph(:billing_expenses), volunteer_billing_expenses_path(@volunteer), title: 'Spesenformulare'
......
......@@ -6,9 +6,9 @@ tr
= link_to 'Freiwillige/n hinzufügen',
group_assignments_path(group_assignment: { group_offer_id: @group_offer.id, volunteer_id: volunteer.id }),
class: 'btn btn-default', method: :post
- elsif volunteer.seeking_clients?
- elsif volunteer.seeking_clients? && !volunteer.external
= button_link 'Klient/in suchen', find_client_volunteer_path(id: volunteer)
- elsif volunteer.clients.any? && (volunteer.assignments.any? || volunteer.group_assignments.any?)
- elsif volunteer.clients.any? && (volunteer.assignments.any? || volunteer.group_assignments.any?) && !volunteer.external
= button_link t('.show_assignments'), volunteer_path(volunteer, anchor: 'assignments')
- else
= t('not_assignable')
......
......@@ -338,4 +338,22 @@ class VolunteersTest < ApplicationSystemTestCase
visit edit_volunteer_path(@resigned)
assert page.has_field? 'Prozess', disabled: true
end
test 'external volunteer can not get machted with a client' do
@external = create :volunteer_external, acceptance: :accepted
visit volunteers_path
# "Klient/en" suchen button is not shown on volunteer index
within page.find('tr', text: @external.full_name) do
assert_text 'Nicht zuweisbar'
end
# "Klient/en" suchen button is not shown on volunteer show
visit volunteer_path(@external)
refute page.has_button? 'Klienten suchen'
# "Klient/en" suchen button is not shown on volunteer edit
visit edit_volunteer_path(@external)
refute page.has_button? 'Klienten suchen'
end
end
Supports Markdown
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