added Jaun, and tidied up the live coder view
This commit is contained in:
@ -149,7 +149,7 @@ class AnswerFormatValidatorTest < ActiveSupport::TestCase
|
||||
|
||||
test "live_code should FAIL without values" do
|
||||
obj = AnswerValidatable.new('live_code')
|
||||
obj.answer = { later: "", html: "", css: "", js: "", text: "" }
|
||||
obj.answer = { text: "", html: "", css: "", js: "" }
|
||||
|
||||
refute obj.valid?
|
||||
assert_match(/write.*code/, obj.errors.messages[:answer][0])
|
||||
@ -157,7 +157,7 @@ class AnswerFormatValidatorTest < ActiveSupport::TestCase
|
||||
|
||||
test "live_code should PASS with text only" do
|
||||
obj = AnswerValidatable.new('live_code')
|
||||
obj.answer = { later: "", html: "", css: "", js: "", text: "reasons" }
|
||||
obj.answer = { html: "", css: "", js: "", text: "reasons" }
|
||||
|
||||
assert obj.valid?
|
||||
assert obj.errors.messages.empty?
|
||||
|
Reference in New Issue
Block a user