custom error validations
This commit is contained in:
@ -50,5 +50,13 @@ class CandidateControllerTest < ActionDispatch::IntegrationTest
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
# should get flash message on bad question
|
||||
test "should get flash message on bad radio response" do
|
||||
setup_auth candidates(:martha)
|
||||
qid = questions(:fed1).id
|
||||
post post_radio_url, params: { answer: { question_id: qid, radio: nil } }
|
||||
|
||||
assert_response :success
|
||||
assert session[:test_id].present?
|
||||
assert_equal qid, flash[:answer_error]
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user