Sanitize translations instead of using _html
Using the `_html` suffix in an i18n key is the same as using `html_safe` on it, which means that translation could potentially be used for XSS attacks.
This commit is contained in:
@@ -56,7 +56,7 @@ shared_examples "followable" do |followable_class_name, followable_path, followa
|
||||
scenario "Should display new follower notice after user clicks on follow button", :js do
|
||||
user = create(:user)
|
||||
login_as(user)
|
||||
create_notice_message = t("shared.followable.#{followable_class_name}.create.notice_html")
|
||||
create_notice_message = t("shared.followable.#{followable_class_name}.create.notice")
|
||||
|
||||
visit send(followable_path, arguments)
|
||||
within "##{dom_id(followable)}" do
|
||||
@@ -91,7 +91,7 @@ shared_examples "followable" do |followable_class_name, followable_path, followa
|
||||
scenario "Should display destroy follower notice after user clicks on unfollow button", :js do
|
||||
user = create(:user, followables: [followable])
|
||||
login_as(user)
|
||||
destroy_notice_message = t("shared.followable.#{followable_class_name}.destroy.notice_html")
|
||||
destroy_notice_message = t("shared.followable.#{followable_class_name}.destroy.notice")
|
||||
|
||||
visit send(followable_path, arguments)
|
||||
within "##{dom_id(followable)}" do
|
||||
|
||||
Reference in New Issue
Block a user