File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
test/cadet_web/admin_controllers Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,7 @@ defmodule CadetWeb.Router do
132132 put ( "/users" , AdminUserController , :upsert_users_and_groups )
133133 put ( "/users/:course_reg_id/role" , AdminUserController , :update_role )
134134 delete ( "/users/:course_reg_id" , AdminUserController , :delete_user )
135+ get ( "/users/:course_reg_id/goals" , AdminGoalsController , :index_goals_with_progress )
135136 post ( "/users/:course_reg_id/goals/:uuid/progress" , AdminGoalsController , :update_progress )
136137
137138 put ( "/achievements" , AdminAchievementsController , :bulk_update )
@@ -140,7 +141,6 @@ defmodule CadetWeb.Router do
140141
141142 get ( "/goals" , AdminGoalsController , :index )
142143 put ( "/goals" , AdminGoalsController , :bulk_update )
143- get ( "/goals/:course_reg_id" , AdminGoalsController , :index_goals_with_progress )
144144 put ( "/goals/:uuid" , AdminGoalsController , :update )
145145 delete ( "/goals/:uuid" , AdminGoalsController , :delete )
146146
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ defmodule CadetWeb.AdminGoalsControllerTest do
5454 end
5555 end
5656
57- describe "GET v2/courses/:course_id/admin/goals/:userid " do
57+ describe "GET v2/courses/:course_id/admin/users/:course_reg_id/goals " do
5858 @ tag authenticate: :staff
5959 test "succeeds for staff" , % { conn: conn } do
6060 course = conn . assigns . test_cr . course
@@ -77,7 +77,7 @@ defmodule CadetWeb.AdminGoalsControllerTest do
7777
7878 [ resp_goal ] =
7979 conn
80- |> get ( build_path ( course . id , course_reg . id ) )
80+ |> get ( build_user_goals_path ( course . id , course_reg . id ) )
8181 |> json_response ( 200 )
8282
8383 assert goal_json_literal ( 5 ) = resp_goal
@@ -315,4 +315,8 @@ defmodule CadetWeb.AdminGoalsControllerTest do
315315 defp build_path ( course_id , uuid , course_reg_id ) do
316316 "/v2/courses/#{ course_id } /admin/users/#{ course_reg_id } /goals/#{ uuid } /progress/"
317317 end
318+
319+ defp build_user_goals_path ( course_id , course_reg_id ) do
320+ "/v2/courses/#{ course_id } /admin/users/#{ course_reg_id } /goals"
321+ end
318322end
You can’t perform that action at this time.
0 commit comments