From 0a5e9afab05a7e0d1c38e0298c139b0317eb1546 Mon Sep 17 00:00:00 2001 From: Alessandro Caporrini Date: Fri, 22 Feb 2019 04:07:52 +0100 Subject: [PATCH 1/2] Improve Invitation email text (#488) Improve Invitation email text to say more about the current state of Scanner and concerns around alarmism. Thanks, @acaporrini! --- .../invitation_email.html.erb | 20 ++++++++++-- .../invitation_email.text.erb | 16 ++++++++-- test/mailers/invitation_mailer_test.rb | 31 +++++++++++++++++-- 3 files changed, 60 insertions(+), 7 deletions(-) diff --git a/app/views/invitation_mailer/invitation_email.html.erb b/app/views/invitation_mailer/invitation_email.html.erb index c67d0420..a0b5c660 100644 --- a/app/views/invitation_mailer/invitation_email.html.erb +++ b/app/views/invitation_mailer/invitation_email.html.erb @@ -1,7 +1,23 @@

- 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" %> +

+ 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: <%= 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 Date: Fri, 22 Feb 2019 08:35:58 -0800 Subject: [PATCH 2/2] Upgrade Bootsnap to 1.4.0 (#489) Ever since I finally upgraded to MacOS 10.14 last month, I've been having issues with the Rails console. Turns out it's a problem with Bootsnap that seems to have gotten fixed in the latest version. --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index f25d8378..f1b0464b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -63,7 +63,7 @@ GEM aws-sigv4 (1.0.3) bcrypt (3.1.12) bindex (0.5.0) - bootsnap (1.3.2) + bootsnap (1.4.0) msgpack (~> 1.0) builder (3.2.3) byebug (10.0.2) @@ -140,7 +140,7 @@ GEM mini_portile2 (2.4.0) minitest (5.11.3) mono_logger (1.1.0) - msgpack (1.2.4) + msgpack (1.2.6) multi_json (1.13.1) multi_xml (0.6.0) multipart-post (2.0.0) @@ -336,4 +336,4 @@ RUBY VERSION ruby 2.5.1p57 BUNDLED WITH - 1.16.4 + 1.17.3