Commit 5f1d5a96 authored by Jiri Strojil's avatar Jiri Strojil

Fixed more tests

parent 4130cb41
Pipeline #33483 failed with stage
in 34 minutes and 44 seconds
......@@ -6,21 +6,9 @@ class JournalsControllerTest < ActionDispatch::IntegrationTest
@reminder_mailing = create :reminder_mailing, :trial_period
@assignment = @reminder_mailing.reminder_mailing_volunteers.first.reminder_mailable
@volunteer = @assignment.volunteer
@feedback = create :feedback, feedbackable: @assignment, volunteer: @volunteer, author: @volunteer.user
login_as @superadmin
end
test '#new prefilles with feedback quote if feedback_id param is passed for trial period' do
get new_volunteer_journal_path(@volunteer, feedback_id: @feedback.id)
@journal = @controller.instance_variable_get(:@journal)
assert_equal @journal.category, 'feedback'
assert_equal @journal.title, "Feedback vom #{I18n.l(@feedback.created_at.to_date)}: "
assert @journal.body.include? @feedback.goals
assert @journal.body.include? @feedback.achievements
assert @journal.body.include? @feedback.future
assert @journal.body.include? @feedback.comments
end
test '#new prefilling for semester feedback quote if semester_feedback_id param is passed works also' do
@spv = create(:semester_process_volunteer, volunteer: @volunteer)
@semester_feedback = create(:semester_feedback, :no_mission, semester_process_volunteer: @spv, volunteer: @volunteer)
......
......@@ -2,13 +2,9 @@ require 'test_helper'
class ListResponsePolicyTest < PolicyAssertions::Test
test 'only superadmin can use all actions' do
assert_permit create(:user), :list_response,
'feedbacks?', 'trial_feedbacks?'
refute_permit create(:volunteer).user, :list_response,
'feedbacks?', 'trial_feedbacks?'
refute_permit create(:department_manager), :list_response,
'feedbacks?', 'trial_feedbacks?'
refute_permit create(:social_worker), :list_response,
'feedbacks?', 'trial_feedbacks?'
assert_permit create(:user), :list_response, 'trial_feedbacks?'
refute_permit create(:volunteer).user, :list_response, 'trial_feedbacks?'
refute_permit create(:department_manager), :list_response, 'trial_feedbacks?'
refute_permit create(:social_worker), :list_response, 'trial_feedbacks?'
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