mirror of
https://github.com/openstreetmap/openstreetmap-website.git
synced 2025-08-16 17:07:06 +00:00
Merge remote-tracking branch 'upstream/pull/6125'
This commit is contained in:
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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")
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user