admin controller tests, sans question
This commit is contained in:
@ -3,19 +3,38 @@ require 'test_helper'
|
||||
module Admin
|
||||
class AuthControllerTest < ActionDispatch::IntegrationTest
|
||||
test "should get login" do
|
||||
get admin_url
|
||||
get admin_login_url
|
||||
assert_response :success
|
||||
assert_template 'admin/auth/login'
|
||||
end
|
||||
|
||||
test "should get auth" do
|
||||
post admin_auth_url
|
||||
assert_response :success
|
||||
test "should get logout" do
|
||||
post admin_auth_url, params: { auth:
|
||||
{ email: 'alan.admin@mailinator.com', password: 'password' } }
|
||||
|
||||
get admin_logout_url
|
||||
assert_redirected_to admin_login_url
|
||||
assert session[:user].nil?
|
||||
end
|
||||
|
||||
test "should get logout" do
|
||||
get admin_logout_url
|
||||
assert_response :success
|
||||
test "should auth to dashboard" do
|
||||
post admin_auth_url, params: { auth:
|
||||
{ email: 'alan.admin@mailinator.com', password: 'password' } }
|
||||
assert_redirected_to admin_url
|
||||
end
|
||||
|
||||
test "recruiter should not admin auth" do
|
||||
post admin_auth_url, params: { auth:
|
||||
{ email: 'pdr.recruiter@mailinator.com', password: 'password' } }
|
||||
assert_redirected_to admin_login_url
|
||||
assert_match(/incorrect.*email/, flash[:error])
|
||||
end
|
||||
|
||||
test "reviewer should not admin auth" do
|
||||
post admin_auth_url, params: { auth:
|
||||
{ email: 'fed.reviewer@mailinator.com', password: 'password' } }
|
||||
assert_redirected_to admin_login_url
|
||||
assert_match(/incorrect.*email/, flash[:error])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user