parent
5c3691ebe0
commit
58d3fbd7c2
@ -54,7 +54,7 @@ module Admin
|
||||
private
|
||||
|
||||
def candidate_params
|
||||
params.require(:candidate).permit(:name, :email, :experience, :quiz_id)
|
||||
params.require(:candidate).permit(:name, :email, :experience, :quiz_id, :project)
|
||||
end
|
||||
|
||||
def collect_quizzes
|
||||
|
@ -14,6 +14,7 @@ class Candidate < ApplicationRecord
|
||||
validates :recruiter_id, presence: true
|
||||
validates :name, presence: true
|
||||
validates :experience, presence: true
|
||||
validates :project, presence: true
|
||||
validates :email, uniqueness: true, presence: true, email_format: true
|
||||
validates :test_hash, uniqueness: true, presence: true
|
||||
|
||||
|
@ -16,6 +16,11 @@
|
||||
<%= form.select :experience, experience_options(candidate.experience), include_blank: false %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<%= form.label :project, "Client or project" %>
|
||||
<%= form.text_field :project %>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<%= form.label :quiz_id, "Quiz" %>
|
||||
<%= form.select :quiz_id, quiz_options(quizzes, candidate.quiz_id), include_blank: (quizzes.size > 1) %>
|
||||
|
@ -7,6 +7,7 @@
|
||||
<tr>
|
||||
<th>Test ID</th>
|
||||
<th>Experience</th>
|
||||
<th>Client/Project</th>
|
||||
<th>Recruiter</th>
|
||||
<th>Submitted on</th>
|
||||
<th>Interview?</th>
|
||||
@ -16,6 +17,7 @@
|
||||
<tr>
|
||||
<td><%= link_to candidate.test_hash, admin_result_path(candidate.test_hash) %></td>
|
||||
<td><%= candidate.experience %> years</td>
|
||||
<td><%= candidate.project %></td>
|
||||
<td><%= mail_to(candidate.recruiter.email) %></td>
|
||||
<td><%= candidate.completed_at.strftime('%D') unless candidate.completed_at.nil? %></td>
|
||||
<td><%= candidate.interview? %></td>
|
||||
|
@ -9,6 +9,7 @@
|
||||
<div>
|
||||
<strong>Test ID:</strong> <%= @candidate.test_hash %><br />
|
||||
<strong>Years of Experience:</strong> <%= @candidate.experience %><br />
|
||||
<strong>Client/Project:</strong> <%= @candidate.project %><br />
|
||||
<strong>Recruiter Email:</strong> <%= mail_to @candidate.recruiter.name, @candidate.recruiter.email %><br />
|
||||
</div>
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
<strong>Candidate email:</strong> <%= @candidate.email %><br />
|
||||
<strong>Candidate ID:</strong> <%= @candidate.test_hash %><br />
|
||||
<strong>Years of experience:</strong> <%= @candidate.experience %> Years<br />
|
||||
<strong>Client/Project:</strong> <%= @candidate.project %><br />
|
||||
</p>
|
||||
|
||||
<p>You will be notified when the candidate has finished taking the test.</p>
|
||||
|
@ -6,5 +6,6 @@ Candidate name: <%= @candidate.name %>
|
||||
Candidate email: <%= @candidate.email %>
|
||||
Candidate ID: <%= @candidate.test_hash %>
|
||||
Years of experience: <%= @candidate.experience %> Years
|
||||
Client/Project: <%= @candidate.project %>
|
||||
|
||||
You will be notified when the candidate has finished taking the test.
|
||||
|
@ -1,6 +1,9 @@
|
||||
<row>
|
||||
<columns class="email-body">
|
||||
<p>Candidate <strong><%= @candidate.test_hash %></strong> has completed the Skills Assessment Test.</p>
|
||||
<p>
|
||||
Candidate <strong><%= @candidate.test_hash %></strong> has completed the
|
||||
Skills Assessment Test for client/project <%= @candidate.project %>.
|
||||
</p>
|
||||
<p>You can view the results here: <%= link_to nil, admin_result_url(@candidate.test_hash) %>.</p>
|
||||
</columns>
|
||||
</row>
|
||||
|
@ -1,5 +1,5 @@
|
||||
PERFICIENT/digital SKILLS ASSESSMENT RESULTS
|
||||
|
||||
Candidate <%= @candidate.test_hash %> has completed the Skills Assessment Test.
|
||||
Candidate <%= @candidate.test_hash %> has completed the Skills Assessment Test for client/project <%= @candidate.project %>.
|
||||
|
||||
You can view the results here: <%= admin_result_url(@candidate.test_hash) %>.
|
||||
|
6
db/migrate/20170208212526_add_project_to_client.rb
Normal file
6
db/migrate/20170208212526_add_project_to_client.rb
Normal file
@ -0,0 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
class AddProjectToClient < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
add_column :candidates, :project, :string, after: :experience
|
||||
end
|
||||
end
|
@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20161204220527) do
|
||||
ActiveRecord::Schema.define(version: 20170208212526) do
|
||||
|
||||
create_table "answers", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8" do |t|
|
||||
t.integer "candidate_id"
|
||||
@ -30,6 +30,7 @@ ActiveRecord::Schema.define(version: 20161204220527) do
|
||||
t.string "name"
|
||||
t.string "email"
|
||||
t.string "experience"
|
||||
t.string "project"
|
||||
t.integer "recruiter_id"
|
||||
t.boolean "completed"
|
||||
t.datetime "completed_at"
|
||||
|
@ -23,8 +23,13 @@ module Admin
|
||||
|
||||
assert_enqueued_jobs 2 do
|
||||
assert_difference("Candidate.count") do
|
||||
post admin_create_candidate_path, params: { candidate:
|
||||
{ name: 'new name', email: 'test@mailinator.com', experience: '0-3', quiz_id: quizzes(:fed).id } }
|
||||
post admin_create_candidate_path, params: { candidate: {
|
||||
name: 'new name',
|
||||
email: 'test@mailinator.com',
|
||||
experience: '0-3',
|
||||
project: 'client project',
|
||||
quiz_id: quizzes(:fed).id
|
||||
} }
|
||||
end
|
||||
end
|
||||
assert_redirected_to admin_candidates_path
|
||||
|
11
test/fixtures/candidates.yml
vendored
11
test/fixtures/candidates.yml
vendored
@ -4,6 +4,7 @@ roy: # Roy should have started, and is ready for a reminder
|
||||
name: Roy Cruz
|
||||
email: <%= CryptSerializer.dump 'roy.cruz@mailinator.com' %>
|
||||
experience: 0-3
|
||||
project: Client/Project
|
||||
recruiter: recruiter
|
||||
quiz: fed
|
||||
completed: false
|
||||
@ -14,6 +15,7 @@ gillian: # Gillian has not begun the test
|
||||
name: Gillian Anderson
|
||||
email: <%= CryptSerializer.dump 'gillian.anderson@mailinator.com' %>
|
||||
experience: 4-6
|
||||
project: Client/Project
|
||||
recruiter: recruiter
|
||||
quiz: fed
|
||||
completed: false
|
||||
@ -24,6 +26,7 @@ martha: # Martha has not begun the test
|
||||
name: Martha Watts
|
||||
email: <%= CryptSerializer.dump 'martha.watts@mailinator.com' %>
|
||||
experience: 4-6
|
||||
project: Client/Project
|
||||
recruiter: recruiter
|
||||
quiz: fed
|
||||
completed: false
|
||||
@ -34,6 +37,7 @@ dawn: # Dawn has completed, and been reminded, but not submitted the test
|
||||
name: Dawn Hopkins
|
||||
email: <%= CryptSerializer.dump 'dawn.hopkins@mailinator.com' %>
|
||||
experience: 0-2
|
||||
project: Client/Project
|
||||
recruiter: recruiter
|
||||
quiz: fed
|
||||
completed: false
|
||||
@ -44,6 +48,7 @@ peggy: # Peggy has completed, and been reminded, but not submitted the test
|
||||
name: Peggy Blisters
|
||||
email: <%= CryptSerializer.dump 'peggy.blisters@mailinator.com' %>
|
||||
experience: 0-2
|
||||
project: Client/Project
|
||||
recruiter: recruiter
|
||||
quiz: fed
|
||||
completed: false
|
||||
@ -54,6 +59,7 @@ richard: # Richard has completed AND submitted the test
|
||||
name: Richard Burns
|
||||
email: <%= CryptSerializer.dump 'richard.burns@mailinator.com' %>
|
||||
experience: 15+
|
||||
project: Client/Project
|
||||
recruiter: recruiter
|
||||
quiz: fed
|
||||
completed: true
|
||||
@ -66,6 +72,7 @@ juan: # Juan has chosen "finish later" for live coders
|
||||
name: Juan Campbell
|
||||
email: <%= CryptSerializer.dump 'juan.campbell@mailinator.com' %>
|
||||
experience: 15+
|
||||
project: Client/Project
|
||||
recruiter: recruiter
|
||||
quiz: fed
|
||||
completed: false
|
||||
@ -76,6 +83,7 @@ stacy: # Stacy has completed AND submitted the test
|
||||
name: Stacy Scott
|
||||
email: <%= CryptSerializer.dump 'stacy.scott@mailinator.com' %>
|
||||
experience: 7-9
|
||||
project: Client/Project
|
||||
recruiter: recruiter
|
||||
quiz: fed
|
||||
completed: true
|
||||
@ -88,6 +96,7 @@ henry: # Henry has completed AND submitted the test
|
||||
name: Henry Butler
|
||||
email: <%= CryptSerializer.dump 'henry.butler@mailinator.com' %>
|
||||
experience: 4-6
|
||||
project: Client/Project
|
||||
recruiter: recruiter
|
||||
quiz: fed
|
||||
completed: true
|
||||
@ -99,6 +108,7 @@ wade: # Wade has completed AND submitted the test
|
||||
name: Wade Armstrong
|
||||
email: <%= CryptSerializer.dump 'wade.armstrong@mailinator.com' %>
|
||||
experience: 0-3
|
||||
project: Client/Project
|
||||
recruiter: recruiter
|
||||
quiz: fed
|
||||
completed: true
|
||||
@ -110,6 +120,7 @@ gustov: # Gustov is NOT for FED
|
||||
name: Gustov
|
||||
email: <%= CryptSerializer.dump 'gustov@mailinator.com' %>
|
||||
experience: 0-3
|
||||
project: Client/Project
|
||||
recruiter: recruiter
|
||||
quiz: admin
|
||||
completed: false
|
||||
|
@ -6,6 +6,7 @@ class CandidateTest < ActiveSupport::TestCase
|
||||
candidate = Candidate.create(name: 'new name',
|
||||
email: 'test@mailinator.com',
|
||||
experience: '0-3',
|
||||
project: 'Client',
|
||||
quiz_id: quizzes(:fed).id)
|
||||
|
||||
assert candidate.test_hash.present?
|
||||
@ -16,6 +17,7 @@ class CandidateTest < ActiveSupport::TestCase
|
||||
candidate = Candidate.create(name: 'new name',
|
||||
email: email,
|
||||
experience: '0-3',
|
||||
project: 'Client',
|
||||
recruiter_id: users(:recruiter).id,
|
||||
quiz_id: quizzes(:fed).id)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user