forked from instructure/canvas-lms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpeople_spec.rb
More file actions
executable file
·646 lines (535 loc) · 23.8 KB
/
Copy pathpeople_spec.rb
File metadata and controls
executable file
·646 lines (535 loc) · 23.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
require File.expand_path(File.dirname(__FILE__) + '/common')
describe "people" do
include_context "in-process server selenium tests"
before(:once) do
driver.manage.window.maximize
end
def add_user(option_text, username, user_list_selector)
click_option('#enrollment_type', option_text)
f('textarea.user_list').send_keys(username)
f('.verify_syntax_button').click
wait_for_ajax_requests
expect(f('#user_list_parsed')).to include_text(username)
f('.add_users_button').click
wait_for_ajaximations
expect(f(user_list_selector)).to include_text(username)
end
def open_student_group_dialog
f('#add-group-set').click
dialog = fj('.ui-dialog:visible')
expect(dialog).to be_displayed
dialog
end
def create_student_group(group_text = "new student group")
expect_new_page_load do
f("#people-options .Button").click
fln('View User Groups').click
end
open_student_group_dialog
replace_content(f('#new_category_name'), group_text)
submit_form('.group-category-create')
wait_for_ajaximations
expect(f('.collectionViewItems')).to include_text(group_text)
end
def enroll_student(student)
e1 = @course.enroll_student(student)
e1.workflow_state = 'active'
e1.save!
@course.reload
end
def enroll_ta(ta)
e1 = @course.enroll_ta(ta)
e1.workflow_state = 'active'
e1.save!
@course.reload
end
def create_user(student_name)
user = User.create!(:name => student_name)
user.register!
user.pseudonyms.create!(:unique_id => student_name, :password => 'qwertyuiop', :password_confirmation => 'qwertyuiop')
@course.reload
user
end
def enroll_more_students
student_1 = create_user("jake@test.com")
student_2 = create_user("test@test.com")
student_3 = create_user("new@test.com")
student_4 = create_user("this@test.com")
enroll_student(student_1)
enroll_student(student_2)
enroll_student(student_3)
enroll_student(student_4)
end
def open_dropdown_menu(selector = ".rosterUser")
row = f(selector)
driver.action.move_to(row).perform
f("#{selector} .admin-links a.al-trigger").click
expect(f("#{selector} .admin-links ul.al-options")).to be_displayed
end
def expect_dropdown_item(option, selector = ".rosterUser")
expect(f("#{selector} .admin-links ul.al-options li a[data-event=#{option}]")).to be_truthy
end
def expect_no_dropdown_item(option, selector = ".rosterUser")
expect(f("#{selector} .admin-links ul.al-options")).not_to contain_css("li a[data-event=#{option}]")
end
# Returns visibility boolean, assumes existence
def dropdown_item_visible?(option, selector = ".rosterUser")
f("#{selector} .admin-links ul.al-options li a[data-event=#{option}]").displayed?
end
def close_dropdown_menu
driver.action.send_keys(:escape).perform
end
context "people as a teacher" do
before (:each) do
course_with_teacher_logged_in
#add first student
@student_1 = create_user('student@test.com')
enroll_student(@student_1)
#adding users for tests to work correctly
#teacher user
@test_teacher = create_user('teacher@test.com')
#student user
@student_2 = create_user('student2@test.com')
#ta user
@test_ta = create_user('ta@test.com')
#observer user
@test_observer = create_user('observer@test.com')
enroll_ta(@test_ta)
get "/courses/#{@course.id}/users"
end
it "should have tabs" do
expect(f('.collectionViewItems>li:first-child').text).to match "Everyone"
end
it "should display a dropdown menu when item cog is clicked" do
open_dropdown_menu
end
it "should display the option to remove a student from a course if manually enrolled" do
open_dropdown_menu("tr[id=user_#{@student_1.id}]")
expect(dropdown_item_visible?('removeFromCourse', "tr[id=user_#{@student_1.id}]")).to be true
end
it "should display the option to remove a student from a course has a SIS ID", priority: "1", test_id: 336018 do
@course.sis_source_id = 'xyz'
@course.save
enroll_student(@student_2)
# need to hit /users page again to show enrollment of 2nd student
get "/courses/#{@course.id}/users"
wait_for_ajaximations
# check 1st student
open_dropdown_menu("tr[id=user_#{@student_1.id}]")
expect(dropdown_item_visible?('removeFromCourse', "tr[id=user_#{@student_1.id}]")).to be true
close_dropdown_menu
# check 2nd student
open_dropdown_menu("tr[id=user_#{@student_2.id}]")
expect(dropdown_item_visible?('removeFromCourse', "tr[id=user_#{@student_2.id}]")).to be true
end
it "should display remove option for student with/without SIS id", priority: "1", test_id: 332576 do
enroll_student(@student_2)
@student = user_with_managed_pseudonym
@course.enroll_student(@student)
@course.save
get "/courses/#{@course.id}/users"
# check 1st student
open_dropdown_menu("tr[id=user_#{@student_1.id}]")
expect(dropdown_item_visible?('removeFromCourse', "tr[id=user_#{@student_1.id}]")).to be true
close_dropdown_menu
# check 2nd student
open_dropdown_menu("tr[id=user_#{@student_2.id}]")
expect(dropdown_item_visible?('removeFromCourse', "tr[id=user_#{@student_2.id}]")).to be true
end
it "should display the option to remove a ta from the course" do
open_dropdown_menu("tr[id=user_#{@test_ta.id}]")
expect(dropdown_item_visible?('removeFromCourse', "tr[id=user_#{@test_ta.id}]")).to be true
end
it "should display activity report on clicking Student Interaction button", priority: "1", test_id: 244446 do
f("#people-options .Button").click
fln("Student Interactions Report").click
expect(f("h1").text).to eq "Teacher Activity Report for #{@user.name}"
end
it "should not display Student Interaction button for a student", priority: "1", test_id: 244450 do
user_session(@student_1)
get "/courses/#{@course.id}/users"
expect(f("#content")).not_to contain_link("Student Interactions Report")
end
it "should focus on the + Group Set button after the tabs" do
driver.execute_script("$('.collectionViewItems > li:last a').focus()")
active = driver.execute_script("return document.activeElement")
active.send_keys(:tab)
check_element_has_focus(f('.group-categories-actions .btn-primary'))
end
# focus test removed. delegated to inst-ui which now implements the modal
it "should validate the main page" do
users = ff('.roster_user_name')
expect(users[1].text).to match @student_1.name
expect(users[0].text).to match @teacher.name
end
it "should navigate to registered services on profile page" do
f("#people-options .Button").click
fln('View Registered Services').click
fln('Link web services to my account').click
expect(f('#unregistered_services')).to be_displayed
end
it "should make a new set of student groups" do
create_student_group
end
it "should test self sign up functionality" do
f("#people-options .Button").click
expect_new_page_load { fln('View User Groups').click }
dialog = open_student_group_dialog
dialog.find_element(:css, '#enable_self_signup').click
expect(dialog.find_element(:css, '#split_groups')).not_to be_displayed
expect(dialog).to include_text("groups now")
end
it "should test self sign up / group structure functionality" do
group_count = "4"
expect_new_page_load do
f("#people-options .Button").click
fln('View User Groups').click
end
dialog = open_student_group_dialog
replace_content(f('#new_category_name'), 'new group')
dialog.find_element(:css, '#enable_self_signup').click
replace_content(fj('input[name="create_group_count"]:visible'), group_count)
submit_form('.group-category-create')
wait_for_ajaximations
expect(@course.groups.count).to eq 4
expect(f('.groups-with-count')).to include_text("Groups (#{group_count})")
end
it "should test group structure functionality" do
enroll_more_students
group_count = "4"
expect_new_page_load do
f("#people-options .Button").click
fln('View User Groups').click
end
dialog = open_student_group_dialog
replace_content(f('#new_category_name'), 'new group')
dialog.find_element(:css, '#split_groups').click
replace_content(fj('input[name="create_group_count"]:visible'), group_count)
expect(@course.groups.count).to eq 0
submit_form('.group-category-create')
wait_for_ajaximations
run_jobs
wait_for_ajaximations
expect(@course.groups.count).to eq group_count.to_i
expect(f('.groups-with-count')).to include_text("Groups (#{group_count})")
end
it "should edit a student group" do
new_group_name = "new group edit name"
create_student_group
fj('.group-category-actions:visible a:visible').click
f('.edit-category').click
edit_form = f('.group-category-edit')
edit_form.find_element(:css, 'input[name="name"]').send_keys(new_group_name)
submit_form(edit_form)
wait_for_ajaximations
expect(f(".collectionViewItems")).to include_text(new_group_name)
end
it "should delete a student group" do
create_student_group
fj('.group-category-actions:visible a:visible').click
f('.delete-category').click
keep_trying_until do
expect(driver.switch_to.alert).not_to be_nil
driver.switch_to.alert.accept
true
end
wait_for_ajaximations
refresh_page
expect(f('.empty-groupset-instructions')).to be_displayed
end
it "should test prior enrollment functionality" do
@course.complete
get "/courses/#{@course.id}/users"
expect_new_page_load do
f("#people-options .Button").click
fln('View Prior Enrollments').click
end
expect(f('#users')).to include_text(@student_1.name)
end
it "should deal with observers linked to multiple students" do
@students = []
@obs = user_model(:name => "The Observer")
2.times do |i|
student_in_course(:name => "Student #{i}")
@students << @student
e = @course.observer_enrollments.create!(:user => @obs, :workflow_state => 'active')
e.associated_user_id = @student.id
e.save!
end
2.times do |i|
student_in_course(:name => "Student #{i+2}")
@students << @student
end
get "/courses/#{@course.id}/users/#{@obs.id}"
f('.more_user_information_link').click
wait_for_ajaximations
enrollments = ff(".enrollment")
expect(enrollments.length).to eq 2
expect(enrollments[0]).to include_text @students[0].name
expect(enrollments[1]).to include_text @students[1].name
end
end
context "people as a TA" do
before (:each) do
course_with_ta_logged_in(:active_all => true)
end
it "should validate that the TA cannot delete / conclude or reset course" do
get "/courses/#{@course.id}/settings"
expect(f("#content")).not_to contain_css('.delete_course_link')
expect(f("#content")).not_to contain_css('.reset_course_content_button')
get "/courses/#{@course.id}/confirm_action?event=conclude"
expect(f('.ui-state-error')).to include_text('Unauthorized')
end
# TODO reimplement per CNVS-29609, but make sure we're testing at the right level
it "should validate that a TA cannot rename a teacher"
end
context "course with multiple sections", priority: "2" do
before(:each) do
course_with_teacher_logged_in
@section2 = @course.course_sections.create!(name: 'section2')
end
it "should save add people form data" do
get "/courses/#{@course.id}/users"
f('#addUsers').click
wait_for_ajaximations
expect(f(".addpeople")).to be_displayed
replace_content(f(".addpeople__peoplesearch textarea"),'student@example.com')
click_option('#peoplesearch_select_role', ta_role.id.to_s, :value)
click_option('#peoplesearch_select_section', 'Unnamed Course', :text)
f('#addpeople_next').click
wait_for_ajaximations
expect(f(".peoplevalidationissues__missing")).to be_displayed
f('#addpeople_back').click
wait_for_ajaximations
#verify form and options have not changed
expect(f('.addpeople__peoplesearch')).to be_displayed
expect(f('.addpeople__peoplesearch textarea').text).to eq 'student@example.com'
expect(first_selected_option(f('#peoplesearch_select_role')).text).to eq 'TA'
expect(first_selected_option(f('#peoplesearch_select_section')).text).to eq 'Unnamed Course'
end
it "should add a student to a section", priority: "1", test_id: 296460 do
student = create_user("student@example.com")
enroll_student(student)
get "/courses/#{@course.id}/users"
f(".StudentEnrollment .icon-settings").click
fln("Edit Sections").click
f(".token_input.browsable").click
section_input_element = driver.find_element(:name, "token_capture")
section_input_element.send_keys("section2")
f('.last.context').click
wait_for_ajaximations
ff('.ui-button-text')[1].click
wait_for_ajaximations
expect(ff(".StudentEnrollment")[0]).to include_text("section2")
end
it "should remove a student from a section", priority: "1", test_id: 296461 do
@student = user_factory
@course.enroll_student(@student, allow_multiple_enrollments: true)
@course.enroll_student(@student, section: @section2, allow_multiple_enrollments: true)
get "/courses/#{@course.id}/users"
f(".StudentEnrollment .icon-settings").click
fln("Edit Sections").click
fln("Remove user from section2").click
ff('.ui-button-text')[1].click
wait_for_ajaximations
expect(ff(".StudentEnrollment")[0]).not_to include_text("section2")
end
it "removes students linked to an observer" do
@student1 = user_factory; @course.enroll_student(@student1, enrollment_state: :active)
@student2 = user_factory; @course.enroll_student(@student2, enrollment_state: :active)
@observer = user_factory
@course.enroll_user(@observer, 'ObserverEnrollment', enrollment_state: :active, associated_user_id: @student1.id, allow_multiple_enrollments: true)
@course.enroll_user(@observer, 'ObserverEnrollment', enrollment_state: :active, associated_user_id: @student2.id, allow_multiple_enrollments: true)
get "/courses/#{@course.id}/users"
f(".ObserverEnrollment .icon-settings").click
fln("Link to Students").click
fln("Remove linked student #{@student1.name}", f("#token_#{@student1.id}")).click
f('.ui-dialog-buttonset .btn-primary').click
wait_for_ajax_requests
expect(@observer.enrollments.not_deleted.map(&:associated_user_id)).not_to include @student1.id
expect(@observer.enrollments.not_deleted.map(&:associated_user_id)).to include @student2.id
end
it "should gray out sections the user doesn't have permission to remove" do
@student = user_with_managed_pseudonym
e = @course.enroll_student(@student, allow_multiple_enrollments: true)
sis = @course.root_account.sis_batches.create
e.sis_batch_id = sis.id
e.save!
get "/courses/#{@course.id}/users"
ff(".icon-settings")[1].click
fln("Edit Sections").click
expect(f('#user_sections li.cannot_remove').text).to include @course.default_section.name
# add another section (not via SIS) and ensure it remains editable
f(".token_input.browsable").click
section_input_element = driver.find_element(:name, "token_capture")
section_input_element.send_keys("section2")
f('.last.context').click
wait_for_ajaximations
expect(f("a[title='Remove user from section2']")).not_to be_nil
f('.ui-dialog-buttonset .btn-primary').click
wait_for_ajaximations
ff(".icon-settings")[1].click
fln("Edit Sections").click
expect(f('#user_sections li.cannot_remove').text).to include @course.default_section.name
expect(f("a[title='Remove user from section2']")).not_to be_nil
end
end
it "should get the max total activity time" do
course_with_admin_logged_in
sec1 = @course.course_sections.create!(name: "section1")
sec2 = @course.course_sections.create!(name: "section2")
@student = user_factory
e1 = @course.enroll_student(@student, section: sec1, allow_multiple_enrollments: true)
@course.enroll_student(@student, section: sec2, allow_multiple_enrollments: true)
Enrollment.where(:id => e1).update_all(:total_activity_time => 900)
get "/courses/#{@course.id}/users"
wait_for_ajaximations
expect(f("#user_#{@student.id} td:nth-child(8)").text.strip).to eq "15:00"
end
it "should filter by role ids" do
account_model
course_with_teacher_logged_in(:account => @account)
old_role = custom_student_role("Role")
old_role.deactivate!
new_role = @account.roles.new(:name => old_role.name)
new_role.base_role_type = "StudentEnrollment"
new_role.save!
new_role
student_in_course(:course => @course, :role => new_role, :name => "number2")
get "/courses/#{@course.id}/users"
click_option("select[name=enrollment_role_id]", new_role.id.to_s, :value)
wait_for_ajaximations
expect(ff('tr.rosterUser').count).to eq 1
end
context "editing role" do
before :once do
course_factory
@section = @course.course_sections.create!(name: "section1")
@teacher = user_with_pseudonym(:active_all => true)
@enrollment = @course.enroll_teacher(@teacher)
end
before :each do
admin_logged_in
end
it "should let observers have their roles changed if they don't have associated users" do
@course.enroll_user(@teacher, "ObserverEnrollment", :allow_multiple_enrollments => true)
get "/courses/#{@course.id}/users"
open_dropdown_menu("#user_#{@teacher.id}")
expect_dropdown_item('editRoles', "#user_#{@teacher.id}")
end
it "should not let observers with associated users have their roles changed" do
student = user_factory
@course.enroll_student(student)
@course.enroll_user(@teacher, "ObserverEnrollment", :allow_multiple_enrollments => true, :associated_user_id => student.id)
get "/courses/#{@course.id}/users"
open_dropdown_menu("#user_#{@teacher.id}")
expect_no_dropdown_item('editRoles', "#user_#{@teacher.id}")
end
def open_role_dialog(user)
f("#user_#{user.id} .admin-links a.al-trigger").click
f("#user_#{user.id} .admin-links a[data-event='editRoles']").click
end
it "should let users change to an observer role" do
get "/courses/#{@course.id}/users"
open_role_dialog(@teacher)
expect(f("#edit_roles #role_id option[selected]")).to include_text("Teacher")
expect(f("#edit_roles #role_id option[value='#{student_role.id}']")).to be_present
expect(f("#edit_roles #role_id option[value='#{observer_role.id}']")).to be_present
end
it "should not let users change to a type they don't have permission to manage" do
@course.root_account.role_overrides.create!(:role => admin_role, :permission => 'manage_students', :enabled => false)
get "/courses/#{@course.id}/users"
open_role_dialog(@teacher)
expect(f("#edit_roles #role_id option[value='#{ta_role.id}']")).to be_present
expect(f("#content")).not_to contain_css("#edit_roles #role_id option[value='#{student_role.id}']")
end
it "should retain the same enrollment state" do
role_name = 'Custom Teacher'
role = @course.account.roles.create(:name => role_name)
role.base_role_type = 'TeacherEnrollment'
role.save!
@enrollment.deactivate
get "/courses/#{@course.id}/users"
open_role_dialog(@teacher)
click_option("#edit_roles #role_id", role.id.to_s, :value)
f('.ui-dialog-buttonpane .btn-primary').click
wait_for_ajaximations
assert_flash_notice_message "Role successfully updated"
expect(f("#user_#{@teacher.id}")).to include_text(role_name)
@enrollment.reload
expect(@enrollment).to be_deleted
new_enrollment = @teacher.enrollments.not_deleted.first
expect(new_enrollment.role).to eq role
expect(new_enrollment.workflow_state).to eq "inactive"
end
it "should work with enrollments in different sections" do
enrollment2 = @course.enroll_user(@teacher, "TeacherEnrollment", :allow_multiple_enrollments => true, :section => @section)
get "/courses/#{@course.id}/users"
open_role_dialog(@teacher)
click_option("#edit_roles #role_id", ta_role.id.to_s, :value)
f('.ui-dialog-buttonpane .btn-primary').click
wait_for_ajaximations
assert_flash_notice_message "Role successfully updated"
expect(@enrollment.reload).to be_deleted
expect(enrollment2.reload).to be_deleted
new_enrollment1 = @teacher.enrollments.not_deleted.where(:course_section_id => @course.default_section).first
new_enrollment2 = @teacher.enrollments.not_deleted.where(:course_section_id => @section).first
expect(new_enrollment1.role).to eq ta_role
expect(new_enrollment2.role).to eq ta_role
end
it "should work with preexiting enrollments in the destination role" do
# should not try to overwrite this one
enrollment2 = @course.enroll_user(@teacher, "TaEnrollment", :allow_multiple_enrollments => true)
get "/courses/#{@course.id}/users"
open_role_dialog(@teacher)
click_option("#edit_roles #role_id", ta_role.id.to_s, :value)
f('.ui-dialog-buttonpane .btn-primary').click
wait_for_ajaximations
assert_flash_notice_message "Role successfully updated"
expect(@enrollment.reload).to be_deleted
expect(enrollment2.reload).to_not be_deleted
end
it "should work with multiple enrollments in one section" do
# shouldn't conflict with each other - should only add one enrollment for the new role
enrollment2 = @course.enroll_user(@teacher, "TaEnrollment", :allow_multiple_enrollments => true)
get "/courses/#{@course.id}/users"
open_role_dialog(@teacher)
expect(f("#edit_roles")).to include_text("This user has multiple roles") # warn them that both roles will be removed
click_option("#edit_roles #role_id", student_role.id.to_s, :value)
f('.ui-dialog-buttonpane .btn-primary').click
wait_for_ajaximations
assert_flash_notice_message "Role successfully updated"
expect(@enrollment.reload).to be_deleted
expect(enrollment2.reload).to be_deleted
new_enrollment = @teacher.enrollments.not_deleted.first
expect(new_enrollment.role).to eq student_role
end
it "should not show the option to edit roles for a soft-concluded course" do
@course.conclude_at = 2.days.ago
@course.restrict_enrollments_to_course_dates = true
@course.save!
get "/courses/#{@course.id}/users"
open_dropdown_menu("#user_#{@teacher.id}")
expect_no_dropdown_item('editRoles', "#user_#{@teacher.id}")
end
it "should not show the option to edit roles for a SIS imported enrollment" do
sis = @course.root_account.sis_batches.create
student = user_with_pseudonym(:active_all => true)
enrollment = @course.enroll_teacher(student)
enrollment.sis_batch_id = sis.id
enrollment.save!
user_session(@teacher)
get "/courses/#{@course.id}/users"
open_dropdown_menu("#user_#{student.id}")
expect_no_dropdown_item('editRoles', "#user_#{student.id}")
end
it "should redirect to groups page " do
user_session(@teacher)
get "/courses/#{@course.id}/users"
group_link = ff('#group_categories_tabs .ui-tabs-nav li').last
expect(group_link).to include_text("Groups")
expect_new_page_load { group_link.click }
expect(driver.current_url).to include("/courses/#{@course.id}/groups")
end
end
end