|
10 | 10 | @course.update_attributes(name: 'teacher course') |
11 | 11 | @course.save! |
12 | 12 | @course.reload |
| 13 | + create_quiz_with_due_date |
13 | 14 | end |
14 | 15 |
|
15 | | - it 'clicking the unpublish button unpublishes a quiz', priority: "1", test_id: 210052 do |
16 | | - @context = @course |
17 | | - q = quiz_model |
18 | | - q.publish! |
19 | | - |
20 | | - get "/courses/#{@course.id}/quizzes/#{q.id}" |
21 | | - expect(f('#quiz-publish-link')).to include_text('Published') |
22 | | - |
23 | | - expect_new_page_load do |
24 | | - f('.quiz-publish-button').click |
25 | | - wait_for_ajaximations |
26 | | - end |
27 | | - |
28 | | - # move mouse to not be hover over the button |
29 | | - driver.mouse.move_to f('#footer') |
30 | | - |
31 | | - keep_trying_until do |
32 | | - expect(f('#quiz-publish-link')).not_to include_text('Published') |
33 | | - expect(f('#quiz-publish-link')).to include_text('Publish') |
| 16 | + context 'when there is a single due date' do |
| 17 | + it 'doesn\'t display "Multiple Dates"' do |
| 18 | + get "/courses/#{@course.id}/quizzes" |
| 19 | + expect(f('.ig-details .date-due')).not_to include_text 'Multiple Dates' |
| 20 | + expect(f('.ig-details .date-available')).not_to include_text 'Multiple Dates' |
34 | 21 | end |
35 | 22 | end |
36 | 23 |
|
37 | 24 | context 'when there are multiple due dates' do |
| 25 | + before(:each) { add_due_date_override(@quiz) } |
38 | 26 |
|
39 | 27 | it 'shows a due date summary', priority: "2", test_id: 210053 do |
40 | | - create_quiz_with_due_date |
41 | | - get "/courses/#{@course.id}/quizzes" |
42 | | - expect(f('.ig-details .date-due')).not_to include_text 'Multiple Dates' |
43 | | - expect(f('.ig-details .date-available')).not_to include_text 'Multiple Dates' |
44 | | - |
45 | | - add_due_date_override(@quiz) |
46 | | - |
| 28 | + # verify page |
47 | 29 | get "/courses/#{@course.id}/quizzes" |
48 | 30 | expect(f('.ig-details .date-due')).to include_text 'Multiple Dates' |
49 | | - driver.mouse.move_to f('.ig-details .date-due a') |
| 31 | + expect(f('.ig-details .date-available')).to include_text 'Multiple Dates' |
| 32 | + |
| 33 | + # verify tooltips |
| 34 | + driver.mouse.move_to f('.ig-details .date-available a') |
50 | 35 | wait_for_ajaximations |
51 | 36 | tooltip = fj('.ui-tooltip:visible') |
52 | 37 | expect(tooltip).to include_text 'New Section' |
53 | 38 | expect(tooltip).to include_text 'Everyone else' |
54 | 39 |
|
55 | | - expect(f('.ig-details .date-available')).to include_text 'Multiple Dates' |
56 | | - driver.mouse.move_to f('.ig-details .date-available a') |
| 40 | + driver.mouse.move_to f('.ig-details .date-due a') |
57 | 41 | wait_for_ajaximations |
58 | 42 | tooltip = fj('.ui-tooltip:visible') |
59 | 43 | expect(tooltip).to include_text 'New Section' |
|
0 commit comments