Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress exit email for CSF 201 #23639

Merged
merged 1 commit into from
Jul 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion dashboard/app/models/pd/enrollment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def exit_survey_url
end

def should_send_exit_survey?
!workshop.fit_weekend?
!workshop.fit_weekend? && workshop.subject != SUBJECT_CSF_201
end

def send_exit_survey
Expand Down
5 changes: 5 additions & 0 deletions dashboard/test/models/pd/enrollment_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ class Pd::EnrollmentTest < ActiveSupport::TestCase
fit_enrollment = create :pd_enrollment, user: create(:teacher), workshop: fit_workshop

refute fit_enrollment.should_send_exit_survey?

csf_201_workshop = create :pd_ended_workshop, course: Pd::Workshop::COURSE_CSF, subject: Pd::Workshop::SUBJECT_CSF_201
csf_201_enrollment = create :pd_enrollment, user: create(:teacher), workshop: csf_201_workshop

refute csf_201_enrollment.should_send_exit_survey?
end

test 'send_exit_survey does not send mail when the survey was already sent' do
Expand Down