Skip to content

Commit 9814b3a

Browse files
committed
spec: fix quiz validation specs for ruby 1.8
Change-Id: I7a5e87e9327d77924a74c50e88373afe3ad210e7 Reviewed-on: https://gerrit.instructure.com/17726 Tested-by: Jenkins <jenkins@instructure.com> Reviewed-by: Jake Sorce <jake@instructure.com> QA-Review: Jake Sorce <jake@instructure.com>
1 parent f6b74d7 commit 9814b3a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

spec/models/quiz_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ def expect_multi_value_row(row, expected_name, expected_values)
10551055
quiz = @course.quizzes.create! :title => "test quiz"
10561056
quiz.quiz_type = "totally_invalid_quiz_type"
10571057
quiz.save.should be_false
1058-
quiz.errors.any?{|e| e =~ /quiz_type/}.should be_true
1058+
quiz.errors["invalid_quiz_type"].should be_present
10591059
end
10601060

10611061
it "should not validate quiz_type if not changed" do
@@ -1073,7 +1073,7 @@ def expect_multi_value_row(row, expected_name, expected_values)
10731073
quiz = @course.quizzes.create! :title => "test quiz"
10741074
quiz.ip_filter = "999.999.1942.489"
10751075
quiz.save.should be_false
1076-
quiz.errors.any?{|e| e =~ /ip_filter/}.should be_true
1076+
quiz.errors["invalid_ip_filter"].should be_present
10771077
end
10781078

10791079
it "should not validate ip_filter if not changed" do
@@ -1091,7 +1091,7 @@ def expect_multi_value_row(row, expected_name, expected_values)
10911091
quiz = @course.quizzes.create! :title => "test quiz"
10921092
quiz.hide_results = "totally_invalid_value"
10931093
quiz.save.should be_false
1094-
quiz.errors.any?{|e| e =~ /hide_results/}.should be_true
1094+
quiz.errors["invalid_hide_results"].should be_present
10951095
end
10961096

10971097
it "should not validate hide_results if not changed" do

0 commit comments

Comments
 (0)