2016-08-07 09:36:08 -05:00
|
|
|
require 'test_helper'
|
|
|
|
|
|
|
|
class QuestionLiveCoderTest < ActionDispatch::IntegrationTest
|
|
|
|
def setup_auth candidate
|
|
|
|
post validate_candidate_url, params: { test_id: candidate.test_hash }
|
|
|
|
end
|
|
|
|
|
|
|
|
test "can load a live coder question" do
|
|
|
|
setup_auth candidates(:dawn)
|
|
|
|
question = questions(:fed7)
|
|
|
|
|
|
|
|
get question_path(question.id)
|
|
|
|
assert_response :success
|
|
|
|
assert_select '.question-text', question.question
|
|
|
|
# TODO: add in capybara and test form post
|
|
|
|
# assert_redirected summary_path
|
|
|
|
end
|
2016-08-23 21:54:53 -05:00
|
|
|
|
|
|
|
test "should load seed data into live coder" do
|
|
|
|
setup_auth candidates(:juan)
|
|
|
|
question = questions(:fed7)
|
|
|
|
|
|
|
|
get question_path(question.id)
|
|
|
|
assert_response :success
|
|
|
|
assert_select '#answer_live_code_html', question.input_options['html']
|
|
|
|
end
|
2016-08-07 09:36:08 -05:00
|
|
|
end
|