diff --git a/spec/selenium/people_spec.rb b/spec/selenium/people_spec.rb index 49eaaf22e16..171e3852b25 100644 --- a/spec/selenium/people_spec.rb +++ b/spec/selenium/people_spec.rb @@ -306,5 +306,13 @@ describe "people" do driver.find_element(:css, '.ui-state-error').should include_text('Unauthorized') end end + + it "should validate that a TA cannot rename a teacher" do + pending('bug 7106 - do not allow TA to edit teachers name') do + teacher_enrollment = teacher_in_course(:name => 'teacher@example.com') + get "/courses/#{@course.id}/users/#{teacher_enrollment.user.id}" + driver.find_element(:css, '.edit_user_link').should_not be_displayed + end + end end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index f04d71c21a4..f1548ec99ff 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -291,6 +291,11 @@ Spec::Runner.configure do |config| course_with_student(opts) end + def teacher_in_course(opts={}) + opts[:course] = @course if @course && !opts[:course] + course_with_teacher(opts) + end + def course_with_teacher(opts={}) course_with_user('TeacherEnrollment', opts) @teacher = @user