Commit 6b8cffa4 authored by Tugce Nur Tas's avatar Tugce Nur Tas
Browse files

add minimum system and model test coverage

parent f3064d41
Pipeline #30913 passed with stage
in 38 minutes and 49 seconds
require 'test_helper'
class SemesterProcessVolunteerTest < ActiveSupport::TestCase
def setup
@volunteer = create(:volunteer_with_user)
@assignment = create(:assignment, volunteer: @volunteer)
@group_assignment = create(:group_assignment, volunteer: @volunteer)
@subject = create(:semester_process_volunteer, volunteer: @volunteer)
end
test 'set responsible also sets responsibility taken at' do
@subject.update(responsible: create(:user))
assert @subject.responsibility_taken_at.present?
end
end
require 'application_system_test_case'
class SemesterProcessVolunteerActionsTest < ApplicationSystemTestCase
setup do
@superadmin = create :user
@volunteer = create :volunteer_with_user
@assignment = create :assignment, volunteer: @volunteer
@group_assignment = create :group_assignment, volunteer: @volunteer
@semester_process = create :semester_process
@spv1 = create(:semester_process_volunteer, :with_mission, volunteer: @volunteer,
semester_process: @semester_process)
login_as @superadmin
end
test 'take responsibility for semester process volunteer works' do
visit semester_process_volunteers_path
within 'tbody' do
page.find("[data-url$=\"#{take_responsibility_semester_process_volunteer_path(@spv1)}\"]").click
end
wait_for_ajax
@spv1.reload
assert page.has_text? "Übernommen durch #{@superadmin.email}"\
" am #{I18n.l(@spv1.responsibility_taken_at.to_date)}"
end
end
......@@ -25,7 +25,8 @@ class ActiveSupport::TestCase
Feedback, TrialFeedback, Hour, Journal, BillingExpense, Certificate, Import,
AssignmentLog, Assignment, GroupAssignmentLog, GroupAssignment, GroupOffer,
ClientNotification, LanguageSkill, Relative, Event, EventVolunteer,
Volunteer, Client, User, Contact, Department
Volunteer, Client, User, Contact, Department, SemesterProcess, SemesterFeedback,
SemesterProcessVolunteer, SemesterProcessVolunteerMission
)
super
......
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