include module_item_id parameter in draft state page redirect

fixes CNVS-12695

test plan:
 - enable draft state
 - add a wiki page to multiple modules
 - click a wiki page link on the modules page
 - the navigation footer should be present on the wiki page

Change-Id: I1e8c1540f40c97e77a289d1dab263dcd748c4475
Reviewed-on: https://gerrit.instructure.com/34300
Reviewed-by: Mark Severson <markse@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
This commit is contained in:
Jeremy Stanley 2014-05-05 09:34:52 -06:00
parent 8a63878c79
commit 9aca437f5b
2 changed files with 6 additions and 1 deletions

View File

@ -44,7 +44,7 @@ class WikiPagesController < ApplicationController
def show
if @context.feature_enabled?(:draft_state)
redirect_to polymorphic_url([@context, :named_page], :wiki_page_id => @page_name || @page, :titleize => params[:titleize])
redirect_to polymorphic_url([@context, :named_page], :wiki_page_id => @page_name || @page, :titleize => params[:titleize], :module_item_id => params[:module_item_id])
return
end
@editing = true if Canvas::Plugin.value_to_boolean(params[:edit])

View File

@ -124,6 +124,11 @@ describe WikiPagesController do
response.should redirect_to(course_named_page_url(@course, "a-page"))
end
it "should forward module_item_id parameter" do
get @base_url + "wiki/a-page?module_item_id=123"
response.should redirect_to(course_named_page_url(@course, "a-page") + "?module_item_id=123")
end
it "should forward /wiki/name/revisions to /pages/name/revisions" do
get @base_url + "wiki/a-page/revisions"
response.should redirect_to(course_named_page_revisions_url(@course, "a-page"))