Remove unused index endpoints

fixes LS-3541
flag=course_paces_redesign

test plan:
- tests pass

Change-Id: Ifdfdc1b833e457e049e9e852f4e5b7e1f5b5734d
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/303490
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Robin Kuss <rkuss@instructure.com>
QA-Review: Robin Kuss <rkuss@instructure.com>
Product-Review: Eric Saupe <eric.saupe@instructure.com>
This commit is contained in:
Eric Saupe 2022-10-18 09:30:53 -07:00
parent 53e7001758
commit 2656f1484a
4 changed files with 0 additions and 86 deletions

View File

@ -24,14 +24,6 @@ class CoursePacing::PacesApiController < ApplicationController
include Api::V1::Progress
def index
render json: {
paces: pacing_service.paces_in_course(course).map do |p|
pacing_presenter.new(p).as_json
end
}
end
def show
pace = pacing_service.pace_for(context, should_duplicate: true)
render json: {

View File

@ -2443,7 +2443,6 @@ CanvasRails::Application.routes.draw do
end
scope(controller: "course_pacing/section_paces_api") do
get "courses/:course_id/section_paces", action: :index, as: :section_paces
get "courses/:course_id/sections/:course_section_id/pace", action: :show, as: :section_pace
post "courses/:course_id/sections/:course_section_id/paces", action: :create, as: :new_section_pace
patch "courses/:course_id/sections/:course_section_id/pace", action: :update, as: :patch_section_pace
@ -2451,7 +2450,6 @@ CanvasRails::Application.routes.draw do
end
scope(controller: "course_pacing/student_enrollment_paces_api") do
get "courses/:course_id/student_enrollment_paces", action: :index, as: :student_enrollment_paces
get "courses/:course_id/student_enrollments/:student_enrollment_id/pace", action: :show, as: :student_enrollment_pace
post "courses/:course_id/student_enrollments/:student_enrollment_id/paces", action: :create, as: :new_student_enrollment_pace
patch "courses/:course_id/student_enrollments/:student_enrollment_id/pace", action: :update, as: :patch_student_enrollment_pace

View File

@ -42,32 +42,6 @@ describe "Section Paces API" do
expect(response.status).to eq 401
end
describe "index" do
let!(:section_pace) { section_pace_model(section: section) }
let!(:section_pace_with_enrollments) { section_pace_model(section: section_two) }
before do
course_pace_model(course: course)
section_pace_model(section: section_three, workflow_state: "deleted")
end
it "returns relevant paces" do
get api_v1_section_paces_path(course.id), params: { format: :json }
expect(response.status).to eq 200
json = JSON.parse(response.body)
expect(
json["paces"].map { |p| p["id"] }
).to match_array(
[section_pace.id, section_pace_with_enrollments.id]
)
[section_pace, section_pace_with_enrollments].each do |pace|
pace_json = json["paces"].detect { |p| p["id"] == pace.id }
expect(pace_json["section"]["name"]).to eq pace.course_section.name
expect(pace_json["section"]["size"]).to eq pace.course_section.enrollments.count
end
end
end
describe "show" do
it "returns the pace for the requested section" do
section_pace = section_pace_model(section: section)
@ -221,20 +195,6 @@ describe "Section Paces API" do
Account.site_admin.disable_feature!(:course_paces_redesign)
end
describe "index" do
before do
section_pace_model(section: section)
section_pace_model(section: section_two)
course_pace_model(course: course)
section_pace_model(section: section_three, workflow_state: "deleted")
end
it "returns 404" do
get api_v1_section_paces_path(course.id), params: { format: :json }
expect(response.status).to eq 404
end
end
describe "show" do
let(:section_pace) { section_pace_model(section: section) }
let(:course_pace) { course_pace_model(course: course) }

View File

@ -38,31 +38,6 @@ describe "Student Enrollment Paces API" do
expect(response.status).to eq 401
end
describe "index" do
let!(:student_pace) { student_enrollment_pace_model(student_enrollment: student_enrollment) }
before do
course_pace_model(course: course)
end
it "returns relevant paces" do
get api_v1_student_enrollment_paces_path(course.id), params: { format: :json }
expect(response.status).to eq 200
json = JSON.parse(response.body)
expect(
json["paces"].map { |p| p["id"] }
).to match_array(
[student_pace.id]
)
pace_json = json["paces"].first
expect(pace_json["student"]["name"]).to eq student.name
end
it "returns a 401 if the user lacks permissions" do
assert_grant_check { get api_v1_student_enrollment_paces_path(course.id), params: { format: :json } }
end
end
describe "show" do
it "returns the pace for the requested student enrollment" do
student_pace = student_enrollment_pace_model(student_enrollment: student_enrollment)
@ -241,17 +216,6 @@ describe "Student Enrollment Paces API" do
Account.site_admin.disable_feature!(:course_paces_redesign)
end
describe "index" do
before do
student_enrollment_pace_model(student_enrollment: student_enrollment)
end
it "returns 404" do
get api_v1_student_enrollment_paces_path(course), params: { format: :json }
expect(response.status).to eq 404
end
end
describe "show" do
before do
student_enrollment_pace_model(student_enrollment: student_enrollment)