I want to test if I'm getting status of 301 when user hits old slug and status of 200 when it's new friendlyID slug.
class SubsectionsController < ApplicationController
def show
section = subsection.section
step = enter code heresubsection.steps.order(:position).first
expected_path = course_section_subsection_step_path(course, section, subsection, step)
return redirect_to expected_path, status: :moved_permanently if request.path != expected_path
redirect_to expected_path
end
def course
Course.friendly.find(params[:course_id])
end
def subsection
Subsection.friendly.find(params[:id])
end
end