Merge remote-tracking branch 'upstream/pull/6125'

This commit is contained in:
Tom Hughes
2025-06-23 16:56:38 +01:00
4 changed files with 8 additions and 8 deletions

View File

@ -14,7 +14,7 @@ class ReportsController < ApplicationController
@report = Report.new
@report.issue = Issue.find_or_initialize_by(create_new_report_params)
else
redirect_to root_path, :notice => t(".missing_params")
head :bad_request
end
end

View File

@ -1656,7 +1656,6 @@ en:
reports:
new:
title_html: "Report %{link}"
missing_params: "Cannot create a new report"
disclaimer:
intro: "Before sending your report to the site moderators, please ensure that:"
not_just_mistake: You are certain that the problem is not just a mistake

View File

@ -1,6 +1,13 @@
require "test_helper"
class ReportsControllerTest < ActionDispatch::IntegrationTest
def test_new_missing_parameters
session_for(create(:user))
get new_report_path
assert_response :bad_request
end
def test_new_report_without_login
target_user = create(:user)
get new_report_path(:reportable_id => target_user.id, :reportable_type => "User")

View File

@ -56,10 +56,4 @@ class ReportDiaryEntryTest < ApplicationSystemTestCase
assert_not_predicate issue, :resolved?
assert_predicate issue, :open?
end
def test_missing_report_params
sign_in_as(create(:user))
visit new_report_path
assert_content I18n.t("reports.new.missing_params")
end
end