test suite refactor
This commit is contained in:
@ -2,12 +2,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class QuestionAttachmentsTest < ActionDispatch::IntegrationTest
|
||||
def setup_auth candidate
|
||||
post validate_candidate_url, params: { test_id: candidate.test_hash }
|
||||
end
|
||||
|
||||
test "should show attachments on question" do
|
||||
setup_auth candidates(:dawn)
|
||||
auth_candidate candidates(:dawn)
|
||||
|
||||
get question_path questions(:fed6)
|
||||
assert_response :success
|
||||
@ -16,7 +12,7 @@ class QuestionAttachmentsTest < ActionDispatch::IntegrationTest
|
||||
end
|
||||
|
||||
test "should show attachments on summary" do
|
||||
setup_auth candidates(:dawn)
|
||||
auth_candidate candidates(:dawn)
|
||||
|
||||
get summary_path
|
||||
assert_response :success
|
||||
|
@ -2,12 +2,8 @@
|
||||
require 'test_helper'
|
||||
|
||||
class QuestionFlowTest < ActionDispatch::IntegrationTest
|
||||
def setup_auth candidate
|
||||
post validate_candidate_url, params: { test_id: candidate.test_hash }
|
||||
end
|
||||
|
||||
test "should load the first question" do
|
||||
setup_auth candidates(:martha)
|
||||
auth_candidate candidates(:martha)
|
||||
|
||||
get question_path
|
||||
assert_response :success
|
||||
@ -15,7 +11,7 @@ class QuestionFlowTest < ActionDispatch::IntegrationTest
|
||||
end
|
||||
|
||||
test "should load the summary" do
|
||||
setup_auth candidates(:dawn)
|
||||
auth_candidate candidates(:dawn)
|
||||
|
||||
get summary_path
|
||||
assert_response :success
|
||||
@ -23,18 +19,16 @@ class QuestionFlowTest < ActionDispatch::IntegrationTest
|
||||
end
|
||||
|
||||
test "can load specific question from summary" do
|
||||
setup_auth candidates(:dawn)
|
||||
auth_candidate candidates(:dawn)
|
||||
question = questions(:fed4)
|
||||
|
||||
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
|
||||
|
||||
test 'juan should be on summary with 80% complete' do
|
||||
setup_auth candidates(:juan)
|
||||
auth_candidate candidates(:juan)
|
||||
|
||||
get summary_path
|
||||
assert_response :success
|
||||
|
@ -2,23 +2,17 @@
|
||||
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)
|
||||
auth_candidate 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
|
||||
|
||||
test "should load seed data into live coder" do
|
||||
setup_auth candidates(:juan)
|
||||
auth_candidate candidates(:juan)
|
||||
question = questions(:fed7)
|
||||
|
||||
get question_path(question.id)
|
||||
|
Reference in New Issue
Block a user