candidate creation
This commit is contained in:
@ -53,4 +53,15 @@ class RecruiterControllerTest < ActionDispatch::IntegrationTest
|
||||
get create_candidate_url
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should create new candidate" do
|
||||
# recruiter = users(:recruiter)
|
||||
setup_auth
|
||||
assert_difference("Candidate.count") do
|
||||
post create_candidate_path, params: { candidate:
|
||||
{ name: 'new name', email: 'test@mailinator.com', experience: '0-3', quiz_id: quizzes(:fed).id } }
|
||||
end
|
||||
assert_redirected_to recruiter_path
|
||||
assert flash[:notice]
|
||||
end
|
||||
end
|
||||
|
@ -1,7 +1,12 @@
|
||||
require 'test_helper'
|
||||
|
||||
class CandidateTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
test "test_hash is auto generated" do
|
||||
candidate = Candidate.create(name: 'new name',
|
||||
email: 'test@mailinator.com',
|
||||
experience: '0-3',
|
||||
quiz_id: quizzes(:fed).id)
|
||||
|
||||
assert candidate.test_hash.present?
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user