validates input_options based on input type
This commit is contained in:
@ -1,7 +1,14 @@
|
||||
require 'test_helper'
|
||||
|
||||
class QuestionTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
test 'should compact arrays for input_options' do
|
||||
question = Question.new(quiz_id: quizzes(:fed).to_i,
|
||||
question: 'foo',
|
||||
category: 'bar',
|
||||
input_type: 'radio',
|
||||
input_options: ['one', 'two', '', ' ', nil])
|
||||
question.validate
|
||||
|
||||
assert_equal 2, question.input_options.count
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user