DEV: Minor improvements to SidebarSectionsController spec (#21734)

1. '#reorder' specs where serializing objects when it is not needed.

2. Add tests for anon user to `#reorder` specs
This commit is contained in:
Alan Guo Xiang Tan
2023-05-25 11:08:10 +09:00
committed by GitHub
parent 038318bffc
commit e8b138e24f
2 changed files with 46 additions and 12 deletions

View File

@@ -85,7 +85,7 @@ class SidebarSectionsController < ApplicationController
order = reorder_params["links_order"].map(&:to_i).each_with_index.to_h
set_order(sidebar_section, order)
render_serialized_sidebar_section(sidebar_section)
render_serialized(sidebar_section, SidebarSectionSerializer)
rescue Discourse::InvalidAccess
render json: failed_json, status: 403
end