if @report.save
@report.issue.save
@report.issue.reopen! unless @report.issue.open?
- redirect_to root_path, :notice => t("issues.create.successful_report")
+ redirect_to helpers.reportable_url(@report.issue.reportable), :notice => t("issues.create.successful_report")
else
redirect_to new_report_path(:reportable_type => @report.issue.reportable_type, :reportable_id => @report.issue.reportable_id), :notice => t("issues.create.provide_details")
end
end
assert_equal 1, Issue.count
assert_response :redirect
- assert_redirected_to root_path
+ assert_redirected_to user_path(target_user.display_name)
end
def test_new_report_with_incomplete_details
end
assert_equal 1, Issue.count
assert_response :redirect
- assert_redirected_to root_path
+ assert_redirected_to user_path(target_user.display_name)
get :new, :params => { :reportable_id => target_user.id, :reportable_type => "User" }
assert_response :success
end
assert_equal 1, Issue.count
assert_response :redirect
- assert_redirected_to root_path
+ assert_redirected_to user_path(target_user.display_name)
# Create a report for an existing Issue
get :new, :params => { :reportable_id => target_user.id, :reportable_type => "User" }