38 lines
898 B
Ruby
38 lines
898 B
Ruby
# frozen_string_literal: true
|
|
require 'test_helper'
|
|
|
|
class QuestionFlowTest < ActionDispatch::IntegrationTest
|
|
test "should load the first question" do
|
|
auth_candidate candidates(:martha)
|
|
|
|
get question_path
|
|
assert_response :success
|
|
assert_select 'h1', questions(:fed1).question
|
|
end
|
|
|
|
test "should load the summary" do
|
|
auth_candidate candidates(:dawn)
|
|
|
|
get summary_path
|
|
assert_response :success
|
|
assert_select 'h1', 'Almost done!'
|
|
end
|
|
|
|
test "can load specific question from summary" do
|
|
auth_candidate candidates(:dawn)
|
|
question = questions(:fed4)
|
|
|
|
get question_path(question.id)
|
|
assert_response :success
|
|
assert_select 'h1', question.question
|
|
end
|
|
|
|
test 'juan should be on summary with 80% complete' do
|
|
auth_candidate candidates(:juan)
|
|
|
|
get summary_path
|
|
assert_response :success
|
|
assert_select 'aside span', '80%'
|
|
end
|
|
end
|