Skip to content

Commit

Permalink
Merge pull request #25181 from code-dot-org/staging
Browse files Browse the repository at this point in the history
DTT (Staging > Test) [robo-dtt]
  • Loading branch information
deploy-code-org committed Oct 2, 2018
2 parents 5cb55d3 + 3bb542b commit b80bf88
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ def self.statuses
before_save :log_status, if: -> {status_changed?}

def should_send_decision_email?
AUTO_EMAIL_STATUSES.include?(status)
if regional_partner&.applications_decision_emails == RegionalPartner::SENT_BY_PARTNER
false
else
AUTO_EMAIL_STATUSES.include?(status)
end
end

def log_status
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,25 @@ class Teacher1920ApplicationTest < ActiveSupport::TestCase
end
end

test 'should_send_decision_email?' do
application = build :pd_teacher1920_application, status: :pending

# no auto-email status: no email
refute application.should_send_decision_email?

# auto-email status with no partner: yes email
application.status = :accepted_no_cost_registration
assert application.should_send_decision_email?

# auto-email status, partner with sent_by_system: yes email
application.regional_partner = build(:regional_partner, applications_decision_emails: RegionalPartner::SENT_BY_SYSTEM)
assert application.should_send_decision_email?

# auto-email status, partner with sent_by_partner: no email
application.regional_partner.applications_decision_emails = RegionalPartner::SENT_BY_PARTNER
refute application.should_send_decision_email?
end

private

def assert_status_log(expected, application)
Expand Down
3 changes: 1 addition & 2 deletions pegasus/src/homepage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ def self.get_actions
youtube_id = "EGgdCryC8Uo"
download_path = "//videos.code.org/social/latam-hour-of-code-2018.mp4"
facebook = "https://www.facebook.com/Code.org/videos/173765420214608/"
# TODO: (ErinB) update this link when the marketing team has a new tweet.
twitter = "Anybody can learn computer science, starting with an #HourOfCode. https://twitter.com/codeorg/status/828716370053304321"
twitter = "Aprender las ciencias de la computación es fundamental para trabajar en el siglo XXI. Si aprendan crear la tecnología del futuro, podrán controlar sus futuros. ¿Qué vas a crear? #HoraDelCodigo #QueVasACrear https://twitter.com/codeorg/status/1047063784949460995"
else
youtube_id = "nKIu9yen5nc"
download_path = "//videos.code.org/social/what-most-schools-dont-teach.mp4"
Expand Down

0 comments on commit b80bf88

Please sign in to comment.