fix failing spec on quiz

fixed:
- since we're not explicitly checking for errors in quiz_submission#save, throw
  an exception if an error happens.
- fix error formatting assertion

Change-Id: I1ac2134a965d329e733c8f54ed2786e06adff91e
Reviewed-on: https://gerrit.instructure.com/29703
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
QA-Review: Derek DeVries <ddevries@instructure.com>
This commit is contained in:
Derek DeVries 2014-02-05 16:18:41 -07:00
parent a3cf4748cc
commit c87397517a
2 changed files with 2 additions and 2 deletions

View File

@ -309,7 +309,7 @@ class Quizzes::Quiz < ActiveRecord::Base
# If the quiz suddenly changes from non-graded to graded,
# then this will update the existing submissions to reflect quiz
# scores in the gradebook.
self.quiz_submissions.each { |s| s.save }
self.quiz_submissions.each { |s| s.save! }
end
attr_accessor :saved_by

View File

@ -972,7 +972,7 @@ describe Quizzes::Quiz do
it "should not allow quiz points higher than allowable by postgres" do
q = Quizzes::Quiz.new(:points_possible => 2000000001)
q.valid?.should == false
q.errors.on(:points_possible).should == "must be less than or equal to 2000000000"
Array(q.errors[:points_possible]).should == ["must be less than or equal to 2000000000"]
end
end