From 0a5e9afab05a7e0d1c38e0298c139b0317eb1546 Mon Sep 17 00:00:00 2001
From: Alessandro Caporrini
- Thanks for volunteering to help analyze changes to government web pages for EDGI! To set up your account, point your web browser to:
+ Thank you for signing up to test our website monitoring software, Scanner!
+
+ Scanner is currently a work in progress and we'd like to be upfront about various limitations and concerns that we have.
+
+ Primarily, we're concerned about erroneous interpretation of changes to webpages that may propagate through social media, news media, or the public more widely. We have seen this happen many times through our work monitoring changes to environmental, climate, and energy websites: <%= link_to "https://envirodatagov.org/website-monitoring", "https://envirodatagov.org/website-monitoring" %>
+
+ Scanner may present certain changes wrongly or mislead users in ways that we cannot yet predict or anticipate. We are working to understand these limitations, but for this reason, we are being careful about who gets access to our platform early on. In the long term, we would love for Scanner to be a public platform for all to use, but we'd like to think about harms and impacts carefully before a public release. +
++ Please do not disseminate information about Scanner or share credentials for Scanner. We'd love for you to check it out and give us feedback in any form that you see fit. You can also follow along with our software development work on GitHub: <%= link_to "https://github.com/edgi-govdata-archiving/web-monitoring", "https://github.com/edgi-govdata-archiving/web-monitoring" %> or chat with us on Slack: <%= link_to "https://archivers-slack.herokuapp.com/", "https://archivers-slack.herokuapp.com/" %> +
++ To set up your account, point your web browser to:
-<%= link_to @url, @url %>
diff --git a/app/views/invitation_mailer/invitation_email.text.erb b/app/views/invitation_mailer/invitation_email.text.erb index 83bd7f4a..8cc84c8a 100644 --- a/app/views/invitation_mailer/invitation_email.text.erb +++ b/app/views/invitation_mailer/invitation_email.text.erb @@ -1,3 +1,15 @@ -Thanks for volunteering to help analyze changes to government web pages for EDGI! To set up your account, point your web browser to: +Thank you for signing up to test our website monitoring software, Scanner! - <%= @url %> +Scanner is currently a work in progress and we'd like to be upfront about various limitations and concerns that we have. + +Primarily, we're concerned about erroneous interpretation of changes to webpages that may propagate through social media, news media, or the public more widely. We have seen this happen many times through our work monitoring changes to environmental, climate, and energy websites: https://envirodatagov.org/website-monitoring + +In the past, people have jumped to conclusions from the changes they see on monitored web sites, assuming data is removed based on a single missing link or a temporary bug on a government web server. The changes you see in Scanner are a great jumping-off point for further research, but remember they are not the whole story, especially if those changes are extremely recent. + +Scanner may present certain changes wrongly or mislead users in ways that we cannot yet predict or anticipate. We are working to understand these limitations, but for this reason, we are being careful about who gets access to our platform early on. In the long term, we would love for Scanner to be a public platform for all to use, but we'd like to think about harms and impacts carefully before a public release. + +Please do not disseminate information about Scanner or share credentials for Scanner. We'd love for you to check it out and give us feedback in any form that you see fit. You can also follow along with our software development work on GitHub: https://github.com/edgi-govdata-archiving/web-monitoring -- or chat with us on Slack: https://archivers-slack.herokuapp.com/ + +To set up your account, point your web browser to: + +<%= @url %> diff --git a/test/mailers/invitation_mailer_test.rb b/test/mailers/invitation_mailer_test.rb index 568b0a97..6d3af406 100644 --- a/test/mailers/invitation_mailer_test.rb +++ b/test/mailers/invitation_mailer_test.rb @@ -1,7 +1,32 @@ require 'test_helper' class InvitationMailerTest < ActionMailer::TestCase - # test "the truth" do - # assert true - # end + # Make it possible to generate URLs. In mailer tests, URL helpers are missing + # the action_mailer URL configuration. + # NOTE: this is handled automatically in RSpec + include Rails.application.routes.url_helpers + def mail_url(route, options = nil) + url_for([ + route, + Rails.application.config.action_mailer.default_url_options.merge(options) + ]) + end + + def test_send_invitation_email + invitation = Invitation.create(email: "test@email.com") + invitation.update_attributes(code: "eff7df8ccc0cd0256619") + email = InvitationMailer.invitation_email(invitation) + + assert_emails 1 do + email.deliver_now + end + + assert_equal "Welcome to EDGI web monitoring", email.subject + assert_equal [ENV.fetch('MAIL_SENDER', 'web-monitoring-db@envirodatagov.org')], email.from + assert_equal ["test@email.com"], email.to + + invite_url = mail_url(:new_user_registration, invitation: invitation.code) + assert_includes email.html_part.body.to_s, invite_url + assert_includes email.text_part.body.to_s, invite_url + end end From 658ae8c091a9ee9818a9be388df03b35190c64cb Mon Sep 17 00:00:00 2001 From: Rob Brackett