successfully redirect after deleting a quiz from the show page
a typo was preventing the redirect from working. fixes #CNVS-2424 test plan: - create a quiz. - go to the /courses/:id/quizzes/:id page - hit the delete button in the right side bar - you should be redirected to the quiz index page Change-Id: If8768c11658eea473bfeb48dbb50d61e8e3e756c Reviewed-on: https://gerrit.instructure.com/16416 QA-Review: Myller de Araujo <myller@instructure.com> Tested-by: Jenkins <jenkins@instructure.com> Reviewed-by: Simon Williams <simon@instructure.com>
This commit is contained in:
parent
36b903ff73
commit
eba1520a66
|
@ -114,7 +114,7 @@
|
|||
<% js_bundle :quiz_show %>
|
||||
<% jammit_css :quizzes, :learning_outcomes %>
|
||||
|
||||
<a id="context_quzzes_url" style="display:none;" href="<%= context_url(@context, :context_quizzes_url) %>"> <!-- This is needed by quiz_show.js --></a>
|
||||
<a id="context_quizzes_url" style="display:none;" href="<%= context_url(@context, :context_quizzes_url) %>"> <!-- This is needed by quiz_show.js --></a>
|
||||
|
||||
<header class="quiz-header">
|
||||
<h2 id="quiz_title"><%= @quiz.quiz_title || @quiz.readable_type %></h2>
|
||||
|
|
|
@ -638,6 +638,14 @@ shared_examples_for "all selenium tests" do
|
|||
end
|
||||
end
|
||||
|
||||
def accept_alert
|
||||
keep_trying_until do
|
||||
alert = driver.switch_to.alert
|
||||
alert.accept
|
||||
true
|
||||
end
|
||||
end
|
||||
|
||||
def in_frame(id, &block)
|
||||
saved_window_handle = driver.window_handle
|
||||
driver.switch_to.frame(id)
|
||||
|
|
|
@ -473,6 +473,19 @@ describe "quizzes" do
|
|||
|
||||
f('#content .question_name').should include_text("Question 1")
|
||||
end
|
||||
|
||||
it "should delete a quiz" do
|
||||
quiz_with_submission
|
||||
get "/courses/#{@course.id}/quizzes/#{@quiz.id}"
|
||||
|
||||
expect_new_page_load do
|
||||
f('.delete_quiz_link').click
|
||||
accept_alert
|
||||
end
|
||||
|
||||
# Confirm that we make it back to the quizzes index page
|
||||
f('#content').should include_text("Course Quizzes")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue