move recruiter to admin/candidate
This commit is contained in:
31
test/controllers/admin/candidate_controller/index_test.rb
Normal file
31
test/controllers/admin/candidate_controller/index_test.rb
Normal file
@ -0,0 +1,31 @@
|
||||
# frozen_string_literal: true
|
||||
require 'test_helper'
|
||||
|
||||
module Admin
|
||||
class CandidateControllerTest < ActionDispatch::IntegrationTest
|
||||
test "should require auth or redirect" do
|
||||
get admin_candidate_url
|
||||
assert_redirected_to admin_login_url
|
||||
|
||||
get admin_new_candidate_url
|
||||
assert_redirected_to admin_login_url
|
||||
|
||||
post admin_create_candidate_url, params: { candidate: { name: 'foo', email: 'bar', experience: 'baz' } }
|
||||
assert_redirected_to admin_login_url
|
||||
end
|
||||
|
||||
test "should get candidate list" do
|
||||
auth_recruiter
|
||||
get admin_candidate_url
|
||||
assert_response :success
|
||||
assert assigns(:candidates), "@candidates not present"
|
||||
end
|
||||
|
||||
test 'should have edit links' do
|
||||
auth_recruiter
|
||||
get admin_candidate_url
|
||||
assert_response :success
|
||||
assert_select "a[href='#{admin_edit_candidate_path(candidates(:martha))}']"
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user