custom error validations

This commit is contained in:
Mark Moser
2016-08-01 09:50:01 -05:00
parent dfd582d251
commit 95eec915c4
11 changed files with 79 additions and 24 deletions

View File

@ -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