Verified Commit 7c7647e1 authored by Kaspar Vollenweider's avatar Kaspar Vollenweider 👻
Browse files

add test for form error on not waive and no iban provided

parent 499fcb1a
Pipeline #20856 failed with stage
in 32 minutes and 40 seconds
......@@ -73,6 +73,11 @@ FactoryBot.define do
weekend { [true, false].sample }
end
trait :waive_expenses do
waive { true }
iban { nil }
end
after(:build) do |volunteer|
if volunteer.accepted? && volunteer.internal?
volunteer.user_id = User.create(role: 'volunteer', email: volunteer.contact.primary_email).id
......
......@@ -122,4 +122,16 @@ class VolunteerSubmitsAfterRemindTest < ApplicationSystemTestCase
refute_text 'hour_volunteer2'
refute_text 'feedback_volunteer2'
end
test 'volunteer_not_waiving_expenses_must_provide_bank_data_on_last_submitted_fb_and_hours' do
volunteer = create :volunteer, :waive_expenses
assignment = create :assignment, volunteer: volunteer
login_as volunteer.user
visit last_submitted_hours_and_feedbacks_assignment_path(assignment)
uncheck 'Ich verzichte auf die Auszahlung'
click_on 'Bestätigen'
within '.assignment_volunteer_iban' do
assert page.has_text? 'darf nicht leer sein'
end
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