adding selenium spec in the assignments rubrics file for BUG #7136

Change-Id: If9a4098c6a8e44b573d1af887a5f007b78691ce0
Reviewed-on: https://gerrit.instructure.com/8722
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
This commit is contained in:
Jake Sorce 2012-02-14 17:37:17 -07:00
parent b5c3b24b7c
commit dbf658a604
3 changed files with 35 additions and 4 deletions

View File

@ -38,8 +38,8 @@ describe "assignment rubrics" do
#Commented out because we still want this test to run but this is the part where the bug is
#BUG 7193 - Rubric total overwrites assignment total despite choosing to leave them different
#get "/courses/#{@course.id}/assignments"
#driver.find_element(:css, '.points_text').should include_text(initial_points.to_s)
#get "/courses/#{@course.id}/assignments"
#driver.find_element(:css, '.points_text').should include_text(initial_points.to_s)
end
it "should import rubric to assignment" do
@ -105,8 +105,6 @@ describe "assignment rubrics" do
get "/courses/#{@course.id}/gradebook/speed_grader?assignment_id=#{@assignment.id}"
wait_for_ajaximations
wait_for_js
keep_trying_until { driver.find_element(:css, '.toggle_full_rubric').should be_displayed }
driver.find_element(:css, '.toggle_full_rubric').click
find_with_jquery('#rubric_holder .criterion:visible .rating').click
@ -210,4 +208,26 @@ describe "assignment rubrics" do
driver.find_element(:css, ".ui-dialog div.long_description").text.should == "This is awesome."
end
end
context "assignment rubrics as an designer" do
before (:each) do
course_with_designer_logged_in
end
it "should allow an designer to create a course rubric" do
pending "Bug #7136 - Rubrics cannot be created by designers" do
rubric_name = 'this is a new rubric'
get "/courses/#{@course.id}/rubrics"
expect {
driver.find_element(:css, '.add_rubric_link').click
replace_content(driver.find_element(:css, '.rubric_title input'), rubric_name)
driver.find_element(:id, 'edit_rubric_form').submit
wait_for_ajaximations
}.to change(Rubric, :count).by(1)
refresh_page
driver.find_element(:css, '#rubrics .title').text.should == rubric_name
end
end
end
end

View File

@ -310,6 +310,11 @@ shared_examples_for "all selenium tests" do
course_with_ta({:user => @user, :active_course => true, :active_enrollment => true}.merge(opts))
end
def course_with_designer_logged_in(opts={})
user_logged_in(opts)
course_with_designer({:user => @user, :active_course => true, :active_enrollment => true}.merge(opts))
end
def course_with_admin_logged_in(opts={})
account_admin_user({:active_user => true}.merge(opts))
user_logged_in({:user => @user}.merge(opts))

View File

@ -287,6 +287,12 @@ Spec::Runner.configure do |config|
@enrollment
end
def course_with_designer(opts={})
course_with_user('DesignerEnrollment', opts)
@designer = @user
@enrollment
end
def course_with_teacher_logged_in(opts={})
course_with_teacher(opts)
user_session(@user)