forked from ontoportal/ontologies_linked_data
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
15 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,7 @@ def self.after_suite | |
|
||
def setup | ||
LinkedData.settings.email_disable_override = true | ||
reset_mailer | ||
end | ||
|
||
def _subscription(ont) | ||
|
@@ -82,13 +83,11 @@ def test_new_note_notification | |
note.save | ||
assert_match "[#{@@ui_name} Notes]", last_email_sent.subject | ||
assert_equal [@@user.email], last_email_sent.to | ||
reset_mailer | ||
ensure | ||
note.delete if note | ||
end | ||
|
||
def test_processing_complete_notification | ||
reset_mailer | ||
options = { ont_count: 1, submission_count: 1, acronym: "NOTIFY" } | ||
ont = LinkedData::SampleData::Ontology.create_ontologies_and_submissions(options)[2].first | ||
subscription = _subscription(ont) | ||
|
@@ -114,7 +113,6 @@ def test_processing_complete_notification | |
end | ||
|
||
def test_disable_administrative_notifications | ||
reset_mailer | ||
LinkedData.settings.enable_administrative_notifications = false | ||
options = { ont_count: 1, submission_count: 1, acronym: "DONTNOTIFY" } | ||
ont = LinkedData::SampleData::Ontology.create_ontologies_and_submissions(options)[2].first | ||
|
@@ -130,7 +128,6 @@ def test_disable_administrative_notifications | |
ont.delete if ont | ||
end | ||
|
||
|
||
def test_remote_ontology_pull_notification | ||
recipients = ["[email protected]"] | ||
ont_count, acronyms, ontologies = LinkedData::SampleData::Ontology.create_ontologies_and_submissions(ont_count: 1, submission_count: 1, process_submission: false) | ||
|
@@ -153,12 +150,11 @@ def test_remote_ontology_pull_notification | |
assert sub.valid?, sub.errors | ||
LinkedData::Utils::Notifications.remote_ontology_pull(sub) | ||
|
||
admin_mails = LinkedData::Utils::Notifier.ontology_admin_emails(ont) | ||
|
||
assert_includes "[#{@@ui_name}] Load from URL failure for #{ont.name}", last_email_sent.subject | ||
recipients = @@support_mails | ||
ont_admins.each do |user| | ||
recipients << user.email | ||
end | ||
assert_equal recipients.sort, last_email_sent.to.sort | ||
assert_equal @@support_mails, all_emails.first.to | ||
assert_equal admin_mails, last_email_sent.to.sort | ||
ensure | ||
ont_admins.each do |user| | ||
user.delete if user | ||
|