From db453cd347cd9b50cdfb4f4e5fb8c46cfa5ee56e Mon Sep 17 00:00:00 2001
From: Brian Austin
<%= style_work_metadata_label(t(".copy.summary")) %>
<% # TODO: Remove to_plain_text when AO3-6519 is fixed. %>
- <%= to_plain_text(raw @summary) %>
+ <%= to_plain_text(raw(strip_images(@summary))) %>
<%= style_work_metadata_label(t(".copy.comment")) %> <%= style_quote(raw @comment) %> <%= style_quote(raw(strip_images(@comment))) %> <%= t(".thank_you") %>
If you have additional questions or information, do not hesitate to send in
diff --git a/app/views/user_mailer/feedback.text.erb b/app/views/user_mailer/feedback.text.erb
index 0ff522c2da5..8cb05659eb9 100644
--- a/app/views/user_mailer/feedback.text.erb
+++ b/app/views/user_mailer/feedback.text.erb
@@ -13,8 +13,8 @@ information you submitted through the Technical Support and Feedback form:
<%= text_divider %>
-* <%= to_plain_text(raw @summary) %> *
-<%= to_plain_text(raw @comment) %>
+* <%= to_plain_text(raw(strip_images(@summary))) %> *
+<%= to_plain_text(raw(strip_images(@comment))) %>
<%= text_divider %>
diff --git a/features/other_a/abuse_report.feature b/features/other_a/abuse_report.feature
index e325ed64718..01636e32302 100644
--- a/features/other_a/abuse_report.feature
+++ b/features/other_a/abuse_report.feature
@@ -59,3 +59,15 @@ Feature: Filing an abuse report
And I press "Submit"
And I should see "Your report was submitted to the Policy & Abuse team. A confirmation message has been sent to the email address you provided."
And 1 email should be delivered
+
+ Scenario: File a report containing images
+
+ Given I am logged in as "otheruser"
+ And basic languages
+ When I follow "Policy Questions & Abuse Reports"
+ And I fill in "Description of the content you are reporting (required)" with "This is wrong"
+ And I fill in "Brief summary of Terms of Service violation (required)" with '
<%= style_work_metadata_label(t(".copy.summary")) %>
- <% # TODO: Remove to_plain_text when AO3-6519 is fixed. %>
- <%= to_plain_text(raw(strip_images(@summary))) %>
+ <%# TODO: Remove to_plain_text when AO3-6519 is fixed. %>
+ <%= to_plain_text(raw(@summary)) %>
<%= style_work_metadata_label(t(".copy.comment")) %>Hi'
+ And I fill in "Link to the page you are reporting (required)" with "http://www.archiveofourown.org/works"
+ And I press "Submit"
+ Then 1 email should be delivered
+ And the email should not contain "
"
diff --git a/features/other_b/support.feature b/features/other_b/support.feature
index d8733c4e088..2f31585e9ca 100644
--- a/features/other_b/support.feature
+++ b/features/other_b/support.feature
@@ -46,4 +46,14 @@ Feature: Filing a support request
And I press "Send"
Then I should see "Your message was sent to the Archive team - thank you!"
And 1 email should be delivered
-
+
+ Scenario: Submit a request containing an image
+
+ Given I am logged in as "puzzled"
+ And basic languages
+ When I follow "Support & Feedback"
+ And I fill in "Brief summary" with "Just a brief note"
+ And I fill in "Your question or problem" with '
Hi'
+ And I press "Send"
+ Then 1 email should be delivered
+ And the email should not contain "
"
diff --git a/test/mailers/previews/user_mailer_preview.rb b/test/mailers/previews/user_mailer_preview.rb
index cb45b301a44..443163bca1e 100644
--- a/test/mailers/previews/user_mailer_preview.rb
+++ b/test/mailers/previews/user_mailer_preview.rb
@@ -1,4 +1,10 @@
class UserMailerPreview < ApplicationMailerPreview
+ # Sent to a user when they submit an abuse report
+ def abuse_report_response
+ abuse_report = create(:abuse_report)
+ UserMailer.abuse_report(abuse_report.id)
+ end
+
# Sends email when an archivist adds someone as a co-creator.
def creatorship_notification_archivist
second_creatorship, first_creator = creatorship_notification_data
@@ -17,6 +23,12 @@ def creatorship_request
UserMailer.creatorship_request(second_creatorship.id, first_creator.id)
end
+ # Sent to a user when the submit a support request (AKA feedback)
+ def feedback_response
+ feedback = create(:feedback)
+ UserMailer.feedback(feedback.id)
+ end
+
private
def creatorship_notification_data
From f1a76a3b59e999bc6a7a409d130d4812a8c210b1 Mon Sep 17 00:00:00 2001
From: Brian Austin
- <%= raw sanitize_field(feedback_comment, :comment_content) %>
+ <%= raw sanitize_field(feedback_comment,
+ :comment_content,
+ strip_images: feedback_comment.ultimate_parent.is_a?(AdminPost)) %>
From c5ddb3a31c156226e31f21478395f8c6ee5e4c87 Mon Sep 17 00:00:00 2001
From: Brian Austin
- <%= raw sanitize_field(feedback_comment,
- :comment_content,
- strip_images: feedback_comment.ultimate_parent.is_a?(AdminPost)) %>
+ <%= raw sanitize_field(feedback_comment, :comment_content, strip_images: feedback_comment.ultimate_parent.is_a?(AdminPost)) %>
From 096f75a767d949f833c1ac0a92e8455be0aea551 Mon Sep 17 00:00:00 2001
From: Brian Austin
<%= raw sanitize_field(feedback_comment, :comment_content, strip_images: feedback_comment.ultimate_parent.is_a?(AdminPost)) %>
diff --git a/app/views/user_mailer/abuse_report.text.erb b/app/views/user_mailer/abuse_report.text.erb
index cb807526868..b5e0baf4d95 100644
--- a/app/views/user_mailer/abuse_report.text.erb
+++ b/app/views/user_mailer/abuse_report.text.erb
@@ -17,10 +17,10 @@
<%= to_plain_text(@url) %>
<%= work_metadata_label(t(".copy.summary")) %>
-<%= to_plain_text(raw(strip_images(@summary))) %>
+<%= to_plain_text(raw @summary) %>
<%= work_metadata_label(t(".copy.comment")) %>
-<%= to_plain_text(raw(strip_images(@comment))) %>
+<%= to_plain_text(raw @comment) %>
<%= text_divider %>
diff --git a/app/views/user_mailer/feedback.text.erb b/app/views/user_mailer/feedback.text.erb
index 8cb05659eb9..0ff522c2da5 100644
--- a/app/views/user_mailer/feedback.text.erb
+++ b/app/views/user_mailer/feedback.text.erb
@@ -13,8 +13,8 @@ information you submitted through the Technical Support and Feedback form:
<%= text_divider %>
-* <%= to_plain_text(raw(strip_images(@summary))) %> *
-<%= to_plain_text(raw(strip_images(@comment))) %>
+* <%= to_plain_text(raw @summary) %> *
+<%= to_plain_text(raw @comment) %>
<%= text_divider %>
From 42c6916129afb71d7f0e8a5d78c41b75f7f38aa5 Mon Sep 17 00:00:00 2001
From: Brian Austin " by "unbeatablesg" on the admin post "Default Admin Post"
+ When I am logged in as "sewwiththeflo"
+ And I go to the homepage
+ Then I should see "My reply"
+ And I should not see "
"