move /review to /admin/results

This commit is contained in:
Mark Moser
2016-09-22 14:19:44 -05:00
parent 9078c463f4
commit 0a9bf96e24
11 changed files with 53 additions and 131 deletions

View File

@ -0,0 +1,23 @@
# frozen_string_literal: true
require 'test_helper'
module Admin
class ResultControllerTest < ActionDispatch::IntegrationTest
test "should get results list" do
auth_reviewer
get admin_results_url
assert_response :success
assert assigns(:candidates), '@candidates not present'
end
test "should get view" do
auth_reviewer
get admin_result_url(candidates(:richard).test_hash)
assert_response :success
assert assigns(:candidate), "@candidate not present"
assert assigns(:quiz), "@quiz not present"
assert assigns(:status), "@status not present"
end
end
end

View File

@ -1,63 +0,0 @@
# frozen_string_literal: true
require 'test_helper'
class ReviewControllerTest < ActionDispatch::IntegrationTest
test "should get login" do
get review_login_url
assert_response :success
end
test "should require auth or redirect" do
get review_url
assert_redirected_to review_login_path
get review_test_url(candidates(:richard).test_hash)
assert_redirected_to review_login_path
end
test "should auth to index" do
auth_reviewer
assert_redirected_to admin_path
assert session[:user].present?
end
test "should fail auth with flash" do
post review_auth_url, params: { auth:
{ email: 'fed.review@mailinator.com', password: 'bad-password' } }
assert_redirected_to review_login_path
assert flash[:error]
end
test "should get review list" do
auth_reviewer
get review_url
assert_response :success
assert assigns(:candidates), '@candidates not present'
end
test "should get index" do
auth_reviewer
get review_url
assert_response :success
end
test "should get view" do
auth_reviewer
get review_test_url(candidates(:richard).test_hash)
assert_response :success
assert assigns(:candidate), "@candidate not present"
assert assigns(:quiz), "@quiz not present"
assert assigns(:status), "@status not present"
end
test 'should logout and reset session' do
auth_reviewer
get review_logout_path
assert :success
assert session[:user].nil?
end
end