|
| 1 | +# |
| 2 | +# Copyright (C) 2011 Instructure, Inc. |
| 3 | +# |
| 4 | +# This file is part of Canvas. |
| 5 | +# |
| 6 | +# Canvas is free software: you can redistribute it and/or modify it under |
| 7 | +# the terms of the GNU Affero General Public License as published by the Free |
| 8 | +# Software Foundation, version 3 of the License. |
| 9 | +# |
| 10 | +# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY |
| 11 | +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
| 12 | +# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more |
| 13 | +# details. |
| 14 | +# |
| 15 | +# You should have received a copy of the GNU Affero General Public License along |
| 16 | +# with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | +# |
| 18 | + |
| 19 | +require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper') |
| 20 | +require File.expand_path(File.dirname(__FILE__) + '/../../views_helper') |
| 21 | + |
| 22 | +describe "/quizzes/quizzes/moderate" do |
| 23 | + let(:num_students) { 5 } |
| 24 | + |
| 25 | + before do |
| 26 | + course_with_teacher |
| 27 | + @students = num_students.times.map do |i| |
| 28 | + name = "#{(i + 'a'.ord).chr}_student" |
| 29 | + course_with_student(name: name, course: @course) |
| 30 | + @student |
| 31 | + end |
| 32 | + course_quiz |
| 33 | + view_context |
| 34 | + assigns[:students] = @students.paginate |
| 35 | + assigns[:quiz] = @quiz |
| 36 | + assigns[:submissions] = [] |
| 37 | + end |
| 38 | + |
| 39 | + it "should render" do |
| 40 | + render "quizzes/quizzes/moderate" |
| 41 | + expect(response).not_to be_nil |
| 42 | + end |
| 43 | + |
| 44 | + it "should have filter options" do |
| 45 | + render "quizzes/quizzes/moderate" |
| 46 | + expect(response.inspect).to include 'Search people. As you type in this field, the list of people will be automatically filtered to only include those whose names match your input.' |
| 47 | + end |
| 48 | +end |
0 commit comments