spec: add selenium spec to people file refs #7106

Change-Id: Iee4623e09ef2fa84cf0e4f47ac6ca2a048ca1a16
Reviewed-on: https://gerrit.instructure.com/9245
Tested-by: Hudson <hudson@instructure.com>
Tested-by: Bryan Madsen <bryan@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
This commit is contained in:
Jake Sorce 2012-03-06 16:03:03 -07:00
parent 4cf755be67
commit 3ef0d3779c
2 changed files with 13 additions and 0 deletions

View File

@ -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

View File

@ -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