split login/welcome and added direct link welcome

This commit is contained in:
Mark Moser
2016-08-02 18:02:20 -05:00
parent 7bdb86f89f
commit 737fd10636
9 changed files with 125 additions and 85 deletions

View File

@ -6,32 +6,42 @@ class CandidateControllerTest < ActionDispatch::IntegrationTest
end
test "should get login" do
get welcome_path
get login_path
assert_response :success
refute flash[:error].present?, "Should not be displaying an error message"
end
test "should require auth and redirect" do
get saved_path
assert_redirected_to welcome_path
assert_redirected_to login_path
get thankyou_path
assert_redirected_to welcome_path
assert_redirected_to login_path
get summary_path
assert_redirected_to welcome_path
assert_redirected_to login_path
get question_path
assert_redirected_to welcome_path
assert_redirected_to login_path
get question_path(questions(:fed1).id)
assert_redirected_to welcome_path
assert_redirected_to login_path
end
test "should auth to question" do
test "should auth to welcome" do
setup_auth candidates(:martha)
assert_redirected_to question_path
assert_redirected_to welcome_path
assert session[:test_id].present?
refute flash[:error].present?, "Should not be displaying an error message"
end
test "should auth directly to welcome" do
get login_path(candidates(:martha).test_hash)
assert_redirected_to welcome_path
assert session[:test_id].present?
refute flash[:error].present?, "Should not be displaying an error message"
end
test "should redirect to thankyou when completed" do