Commit 61c9dfe9 authored by Jiri Strojil's avatar Jiri Strojil
Browse files

Fixed tests

parent a18b1dca
Pipeline #29220 failed with stage
in 7 minutes and 38 seconds
......@@ -5,7 +5,7 @@ FactoryBot.define do
salutation { ['mr', 'mrs'].sample }
acceptance :accepted
group_offer_categories { |category| [category.association(:group_offer_category)] }
waive { false }
waive { true }
iban { generate :iban }
bank { 'Bank' }
association :registrar, factory: :user
......
......@@ -421,7 +421,7 @@ class VolunteerScopesTest < ActiveSupport::TestCase
Volunteer.destroy_all
# load test data
@volunteer_not_logged_in = Volunteer.create!(contact: create(:contact), acceptance: :accepted, salutation: :mrs)
@volunteer_not_logged_in = Volunteer.create!(contact: create(:contact), acceptance: :accepted, salutation: :mrs, waive: true)
Volunteer.acceptance_collection.each do |acceptance|
volunteer = create :volunteer, acceptance: acceptance
instance_variable_set("@volunteer_#{acceptance}", volunteer)
......
......@@ -157,7 +157,7 @@ class VolunteerTest < ActiveSupport::TestCase
end
test 'volunteer_created_as_accepted_gets_invited_for_account' do
volunteer = Volunteer.create!(contact: create(:contact), acceptance: :accepted, salutation: :mrs)
volunteer = Volunteer.create!(contact: create(:contact), acceptance: :accepted, salutation: :mrs, waive: true)
refute_nil volunteer.user_id
assert_equal 'volunteer', volunteer.user.role, 'user role should be volunteer'
assert_equal volunteer.contact.primary_email, volunteer.user.email
......@@ -187,7 +187,7 @@ class VolunteerTest < ActiveSupport::TestCase
end
test 'volunteer can be manually reinvited' do
volunteer = Volunteer.create!(contact: create(:contact), acceptance: :accepted, salutation: :mrs)
volunteer = Volunteer.create!(contact: create(:contact), acceptance: :accepted, salutation: :mrs, waive: true)
invitation_token = volunteer.user.invitation_token
refute_nil volunteer.user_id
refute_nil volunteer.user.invitation_sent_at
......
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