Skip to content

Commit

Permalink
Merge pull request #23639 from code-dot-org/suppress_end_of_workshop_…
Browse files Browse the repository at this point in the history
…emails_for_csf_201

Suppress exit email for CSF 201
  • Loading branch information
mehalshah committed Jul 11, 2018
2 parents 2dcf80e + 5309901 commit 1c5acd5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dashboard/app/models/pd/enrollment.rb
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
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

0 comments on commit 1c5acd5

Please sign in to comment.