html reset

This commit is contained in:
Mark Moser 2017-03-20 10:57:50 -05:00
parent cb6f41fe29
commit 0727440a31
58 changed files with 397 additions and 529 deletions

View File

@ -1,4 +1,4 @@
<nav>
<nav aria-label="Admin Menu">
<%= link_to("Users", admin_users_url) if policy(User).index? %>
<% #= link_to("Departments", admin_departments_url) if policy(Department).index? %>
<%= link_to("Quizzes", admin_quizzes_url) if policy(Quiz).index? %>

View File

@ -1,23 +1,20 @@
<%
content_for :main_class, "intro_tpl"
content_for :title, "Skills Assessment Admin"
%>
<% content_for :title, "Skills Assessment Admin" %>
<h1>Admin Login</h1>
<%= form_for :auth, url: admin_login_path do |form| %>
<% if flash[:error].present? %>
<div class="form-group">
<div>
Need a <%= link_to "password reset", admin_reset_request_path %>?
</div>
<% end %>
<div class="form-group">
<div>
<%= form.label :email %>
<%= form.email_field :email %>
</div>
<div class="form-group">
<div>
<%= form.label :password %>
<%= form.password_field :password %>
</div>

View File

@ -1,22 +1,18 @@
<%
content_for :main_class, "intro_tpl"
content_for :title, "Skills Assessment Admin"
%>
<% content_for :title, "Skills Assessment Admin" %>
<h1>Password Reset</h1>
<%= form_for :auth, url: admin_reset_password_path do |form| %>
<%= hidden_field_tag :reset_token, params[:reset_token] %>
<div class="form-group">
<div>
<%= form.label :password %>
<%= form.password_field :password %>
</div>
<div class="form-group">
<div>
<%= form.label :password_confirmation %>
<%= form.password_field :password_confirmation %>
</div>
<%= submit_tag "Reset Password" %>
<%= hidden_field_tag :reset_token, params[:reset_token] %>
<% end %>

View File

@ -1,12 +1,9 @@
<%
content_for :main_class, "intro_tpl"
content_for :title, "Skills Assessment Admin"
%>
<% content_for :title, "Skills Assessment Admin" %>
<h1>Password Reset</h1>
<%= form_for :auth, url: admin_send_reset_path do |form| %>
<div class="form-group">
<div>
<%= form.label :email %>
<%= form.email_field :email %>
</div>

View File

@ -1,27 +1,27 @@
<%= render partial: 'shared/form_model_errors', locals: { obj: candidate } %>
<%= form_for candidate, url: action, method: :post do |form| %>
<div class="form-group">
<div>
<%= form.label :name, "Candidate name" %>
<%= form.text_field :name %>
</div>
<div class="form-group">
<div>
<%= form.label :email, "Candidate email" %>
<%= form.email_field :email %>
</div>
<div class="form-group">
<div>
<%= form.label :experience, "Years of experience" %>
<%= form.select :experience, experience_options(candidate.experience), include_blank: false %>
</div>
<div class="form-group">
<div>
<%= form.label :project, "Client or project" %>
<%= form.text_field :project %>
</div>
<div class="form-group">
<div>
<%= form.radio_button :position, 'full-time' %>
<%= form.label "position_full-time", "Full-time" %>
@ -29,12 +29,12 @@
<%= form.label :position_contract, "Contract" %>
</div>
<div class="form-group">
<div>
<%= form.label :skill_needs, "Specific skill needs" %>
<%= form.text_field :skill_needs %>
</div>
<div class="form-group">
<div>
<%= form.label :quiz_id, "Quiz" %>
<%= form.select :quiz_id, quiz_options(quizzes, candidate.quiz_id), include_blank: (quizzes.size > 1) %>
</div>

View File

@ -1,10 +1,7 @@
<%
content_for :title, "Edit Candidate - Skills Assessment Admin"
%>
<% content_for :title, "Edit Candidate - Skills Assessment Admin" %>
<main class="intro_tpl">
<h1>Edit: <%= @candidate.name %></h1>
<p><strong>Test ID: </strong><%= @candidate.test_hash %></p>
<h1>Edit: <%= @candidate.name %></h1>
<%= render partial: 'form', locals: { action: admin_update_candidate_path(@candidate.id), candidate: @candidate, quizzes: @quizzes } %>
</main>
<div><strong>Test ID: </strong><%= @candidate.test_hash %></div>
<%= render partial: 'form', locals: { action: admin_update_candidate_path(@candidate.id), candidate: @candidate, quizzes: @quizzes } %>

View File

@ -2,39 +2,37 @@
content_for :section_title, "Candidates"
content_for :title, "Candidates - Skills Assessment Admin"
%>
<main class="summary_tpl">
<%= link_to(admin_new_candidate_path, { class: 'secondary-btn' }) do %>
<button>Create New Candidate</button>
<% end if policy(Candidate).create? %>
<table cellspacing="0" cellpadding="0">
<%= link_to("Create New Candidate", admin_new_candidate_path, { class: "" }) if policy(Candidate).create? %>
<table cellspacing="0" cellpadding="0">
<tr>
<th><%= sortable "name", "Candidate" %></th>
<th><%= sortable "test_hash", "Test ID" %></th>
<th><%= sortable "email" %></th>
<th><%= sortable "experience" %></th>
<th>Progress</th>
<th><%= sortable "completed_at", "Completed" %></th>
<th><%= sortable "reminded" %></th>
<th>Interview?</th>
</tr>
<% @candidates.each do |candidate| %>
<tr>
<th><%= sortable "name", "Candidate" %></th>
<th><%= sortable "test_hash", "Test ID" %></th>
<th><%= sortable "email" %></th>
<th><%= sortable "experience" %></th>
<th>Progress</th>
<th><%= sortable "completed_at", "Completed" %></th>
<th><%= sortable "reminded" %></th>
<th>Interview?</th>
<td><%= link_to candidate.name, admin_edit_candidate_path(candidate.id) %></td>
<td><%= candidate.test_hash %></td>
<td>
<%= mail_to(candidate.email) %>
<br />
<%= link_to "resend welcome email", admin_resend_welcome_path(candidate.id), remote: true, class: '', data: { id: 'ajax-action' } %>
</td>
<td><%= candidate.experience %> years</td>
<td><%= candidate.status %></td>
<td><%= candidate.completed ? link_to("Submitted", admin_result_path(candidate.test_hash)) : "" %></td>
<td><%= candidate.reminded ? "Yes" : "" %></td>
<td><%= candidate.interview? %></td>
</tr>
<% end %>
</table>
<% @candidates.each do |candidate| %>
<tr>
<td><%= link_to candidate.name, admin_edit_candidate_path(candidate.id) %></td>
<td><%= candidate.test_hash %></td>
<td>
<%= mail_to(candidate.email) %>
<br />
<%= link_to "resend welcome email", admin_resend_welcome_path(candidate.id), remote: true, class: '', data: { id: 'ajax-action' } %>
</td>
<td><%= candidate.experience %> years</td>
<td><%= candidate.status %></td>
<td><%= candidate.completed ? link_to("Submitted", admin_result_path(candidate.test_hash)) : "" %></td>
<td><%= candidate.reminded ? "Yes" : "" %></td>
<td><%= candidate.interview? %></td>
</tr>
<% end %>
</table>
<%= paginate @candidates %>
</main>
<%= paginate @candidates %>

View File

@ -1,10 +1,6 @@
<%
content_for :title, "New Candidate - Skills Assessment Admin"
%>
<% content_for :title, "New Candidate - Skills Assessment Admin" %>
<main class="intro_tpl">
<h1>New Candidate</h1>
<h1>New Candidate</h1>
<%= render partial: 'form', locals:
{ action: admin_create_candidate_path, candidate: @candidate, quizzes: @quizzes } %>
</main>
<%= render partial: 'form', locals:
{ action: admin_create_candidate_path, candidate: @candidate, quizzes: @quizzes } %>

View File

@ -4,23 +4,24 @@
%>
<%= render partial: 'shared/form_model_errors', locals: {obj: @user} %>
<%= form_for @user, url: admin_profile_url, method: :post do |form| %>
<div class="form-group">
<div>
<%= form.label :name, "Full Name" %>
<%= form.text_field :name %>
</div>
<div class="form-group">
<div>
<%= form.label :email, "eMail" %>
<%= form.email_field :email %>
</div>
<div class="form-group">
<div>
<%= form.label :password, "New Password" %>
<%= form.password_field :password %>
</div>
<div class="form-group">
<div>
<%= form.label :password_confirmation, "New Password Confirmation" %>
<%= form.password_field :password_confirmation %>
</div>

View File

@ -3,7 +3,8 @@
content_for :title, "Profile - Skills Assessment Admin"
%>
<p>Name: <%= current_user.name %></p>
<p>email: <%= current_user.email %></p>
<p>Role: <%= current_user.role %></p>
<%= link_to('Edit', admin_edit_profile_path, { class: 'btn' }) %>
<div>Name: <%= current_user.name %></div>
<div>email: <%= current_user.email %></div>
<div>Role: <%= current_user.role %></div>
<%= link_to('Edit', admin_edit_profile_path, { class: "" }) %>

View File

@ -9,10 +9,8 @@
</ul>
<% unless (disable ||= false) %>
<div class="form-group">
<div class="btn tertiary-btn" data-id="input_option_adder"> Add option </div>
<li style="display: none;">
<%= text_field_tag 'question[multi_choice][]', nil, { disabled: (disable ||= false), data: { last: nil } } %>
</li>
<div> Add option </div>
<div>
<%= text_field_tag 'question[multi_choice][]', nil, { disabled: (disable ||= false), data: { last: nil } } %>
</div>
<% end %>

View File

@ -12,10 +12,8 @@
</ul>
<% unless (disable ||= false) %>
<div class="form-group">
<div class="btn tertiary-btn" data-id="input_option_adder"> Add option </div>
<li style="display: none;">
<%= text_field_tag 'question[multi_choice][]', nil, { disabled: (disable ||= false), data: { last: nil } } %>
</li>
<div>Add option</div>
<div>
<%= text_field_tag 'question[multi_choice][]', nil, { disabled: (disable ||= false), data: { last: nil } } %>
</div>
<% end %>

View File

@ -1,45 +1,44 @@
<%= render partial: 'shared/form_model_errors', locals: { obj: question} %>
<%= form_for question, url: action do |form| %>
<div class="form-group">
<div>
<%= form.label :quiz_id, 'Quiz' %>
<%= form.select :quiz_id, options_for_select(@quizzes.map{ |q| [q.name, q.id] }, question.quiz_id), include_blank: (@quizzes.size > 1) %>
</div>
<div class="form-group">
<div>
<%= form.label :category, 'Category' %>
<%= form.text_field :category %>
</div>
<div class="form-group">
<div>
<%= form.label :sort, 'Sort' %>
<%= form.text_field :sort %>
</div>
<div class="form-group">
<div>
<%= form.check_box :active %>
<%= form.label :active, 'Active' %>
</div>
<div class="form-group">
<div>
<%= form.label :question, "Question" %>
<%= form.text_area :question %>
</div>
<div class="form-group">
<div>
<%= form.label :attachment, "Attachment URL" %>
<%= form.text_field :attachment %>
<% if @question.attachment.present? %>
<p><%= image_tag @question.attachment %></p>
<% end %>
<%= image_tag @question.attachment if @question.attachment.present? %>
</div>
<div class="form-group">
<div>
<%= form.label :input_type, 'Input Type' %>
<%= form.select :input_type, question_type_options(question.input_type), { include_blank: false }, { data: { qid: question.id } } %>
</div>
<div class="form-group" data-id="input-options-wrapper">
<div>
<%= fields_for @question do |fields| %>
<% partial = question.input_type.blank? ? 'admin/question/text' : "admin/question/#{question.input_type}" %>
<%= render partial: partial, locals: {question: question, fields: fields } %>

View File

@ -9,10 +9,8 @@
</ul>
<% unless (disable ||= false) %>
<div class="form-group">
<div class="btn tertiary-btn" data-id="input_option_adder"> Add option </div>
<li style="display: none;">
<%= text_field_tag 'question[multi_choice][]', nil, { disabled: (disable ||= false), data: { last: nil } } %>
</li>
<div>Add option</div>
<div>
<%= text_field_tag 'question[multi_choice][]', nil, { disabled: (disable ||= false), data: { last: nil } } %>
</div>
<% end %>

View File

@ -1,21 +1,17 @@
<strong>Radio Options</strong>
<ul data-id="input_option_list">
<ul>
<% question.input_options.each do | option | %>
<li>
<%= text_field_tag 'question[multi_choice][]', option, { disabled: (disable ||= false), data: { last: option } } %>
</li>
<% end %>
</ul>
<ul>
<li>Other: <input type="text" disabled="disabled" /></li>
</ul>
<% unless (disable ||= false) %>
<div class="form-group">
<div class="btn tertiary-btn" data-id="input_option_adder"> Add option </div>
<li style="display: none;">
<%= text_field_tag 'question[multi_choice][]', nil, { disabled: (disable ||= false), data: { last: nil } } %>
</li>
<div>Add option</div>
<div>
<%= text_field_tag 'question[multi_choice][]', nil, { disabled: (disable ||= false), data: { last: nil } } %>
</div>
<% end %>

View File

@ -15,7 +15,7 @@
<td><%= question.input_type %></td>
<td><%= question.category %></td>
<td><%= question.active unless question.active? %></td>
<td><%= link_to 'Edit', admin_edit_question_path(question.to_i), { class: 'btn tertiary-btn' } %></td>
<td><%= link_to 'Edit', admin_edit_question_path(question.to_i), { class: "" } %></td>
</tr>
<% end %>
</table>

View File

@ -4,4 +4,5 @@
%>
<h1><%= @question.quiz.name %></h1>
<%= render partial: 'form', locals: {question: @question, action: admin_update_question_path } %>

View File

@ -7,5 +7,5 @@
<% quizzes.each do |quiz, questions| %>
<h1><%= quiz %></h1>
<%= render partial: 'admin/question/table_list', locals: { questions: questions } %>
<%= link_to('Edit Quiz', admin_quiz_path(questions.first.quiz.to_i), { class: 'btn' }) %>
<%= link_to('Edit Quiz', admin_quiz_path(questions.first.quiz.to_i), { class: "" }) %>
<% end %>

View File

@ -3,39 +3,30 @@
content_for :title, "Question - Skills Assessment Admin"
%>
<table cellspacing="0" cellpadding="0">
<tr>
<th>Category</th>
<td><%= @question.category %></td>
</tr>
<tr>
<th>Type</th>
<td><%= @question.input_type %></td>
</tr>
<tr>
<th>Sort</th>
<td><%= @question.sort %></td>
</tr>
<tr>
<th></th>
<td>
<%= check_box_tag 'question_active', nil, @question.active?, {disabled: true} %>
<%= label_tag 'question_active', 'Active' %>
</td>
</tr>
</table>
<h1><%= @question.quiz.name %></h1>
<strong>Question</strong>
<p><%= @question.question %></p>
<h2>Category</h2>
<div><%= @question.category %></div>
<% if @question.attachment.present? %>
<p><%= image_tag @question.attachment %></p>
<% end %>
<h2>Type</h2>
<div><%= @question.input_type %></div>
<h2>Sort</h2>
<div><%= @question.sort %></div>
<div>
<%= check_box_tag 'question_active', nil, @question.active?, {disabled: true} %>
<%= label_tag 'question_active', 'Active' %>
</div>
<h2>Question</h2>
<div><%= @question.question %></div>
<div><%= image_tag @question.attachment if @question.attachment.present? %></div>
<%= fields_for @question do |fields| %>
<%= render partial: "admin/question/#{@question.input_type}", locals: {question: @question, disable: true, fields: fields } %>
<% end %>
<%= link_to('Edit', admin_edit_question_path(@question.to_i), { class: 'btn' }) %>
<%= link_to('View Quiz', admin_quiz_path(@question.quiz_id), { class: 'btn' }) %>
<%= link_to('Edit', admin_edit_question_path(@question.to_i), { class: "" }) %>
<%= link_to('View Quiz', admin_quiz_path(@question.quiz_id), { class: "" }) %>

View File

@ -1,16 +1,16 @@
<%= render partial: 'shared/form_model_errors', locals: { obj: quiz} %>
<%= form_for quiz, url: action do |form| %>
<div class="form-group">
<div>
<%= form.label :name, "Quiz Description" %>
<%= form.text_field :name %>
</div>
<div class="form-group">
<div>
<%= form.label :dept, 'Department' %>
<%= form.text_field :dept %>
</div>
<div class="form-group">
<div>
<%= form.label :unit, 'Unit' %>
<%= form.text_field :unit %>
</div>

View File

@ -13,7 +13,7 @@
<td><%= quiz.dept %></td>
<td><%= quiz.unit %></td>
<td><%= quiz.questions.count %></td>
<td><%= link_to 'edit', admin_edit_quiz_path(quiz.to_i), { class: 'btn tertiary-btn' } if policy(quiz).edit? %></td>
<td><%= link_to 'edit', admin_edit_quiz_path(quiz.to_i), { class: "" } if policy(quiz).edit? %></td>
</tr>
<% end %>
</table>

View File

@ -1,5 +1,3 @@
<%
content_for :section_title, "Edit: #{@quiz.name}"
%>
<% content_for :section_title, "Edit: #{@quiz.name}" %>
<%= render partial: 'form', locals: { quiz: @quiz, action: admin_update_quiz_path } %>

View File

@ -4,4 +4,4 @@
%>
<%= render partial: 'admin/quiz/table_list', locals: { quizzes: @quizzes } %>
<%= link_to('New Quiz', admin_new_quiz_path, { class: 'btn' }) %>
<%= link_to('New Quiz', admin_new_quiz_path, { class: "" }) %>

View File

@ -3,10 +3,10 @@
content_for :title, "Quiz - Skills Assessment Admin"
%>
<p><%= @quiz.name %></p>
<p><%= @quiz.dept %></p>
<p><%= @quiz.unit %></p>
<%= link_to('Edit', admin_edit_quiz_path(@quiz.to_i), { class: 'btn' }) %>
<div><%= @quiz.name %></div>
<div><%= @quiz.dept %></div>
<div><%= @quiz.unit %></div>
<%= link_to('Edit', admin_edit_quiz_path(@quiz.to_i), { class: "" }) %>
<%= render partial: 'admin/question/table_list', locals: { questions: @quiz.questions, disable: true } %>
<%= link_to('New Question', admin_new_question_path, { class: 'btn' }) %>
<%= link_to('New Question', admin_new_question_path, { class: "" }) %>

View File

@ -1,23 +1,20 @@
<div class="comment-message">
<div>
<%= comment.message %>
<% if policy(comment).update? %>
<label class="comment-edit-btn" for="comment-<%= comment.id %>">edit</label>
<label class="" for="comment-<%= comment.id %>">edit</label>
<% end %>
<% if comment.edits? %>
<div class="comment-edit-stamp">Updated <%= time_ago_in_words(comment.updated_at) %> ago</div>
<div>Updated <%= time_ago_in_words(comment.updated_at) %> ago</div>
<% else %>
<div class="comment-edit-stamp"><%= time_ago_in_words(comment.created_at) %> ago</div>
<div><%= time_ago_in_words(comment.created_at) %> ago</div>
<% end %>
</div>
<div class="comment-author"><%= comment.user.name %></div>
<div><%= comment.user.name %></div>
<% if policy(comment).update? %>
<input type="checkbox" id="comment-<%= comment.id %>">
<div class="comment-edit-form">
<%= render partial: 'comment_form', locals: {comment: comment, test_hash: comment.test_hash } %>
</div>
<%= render partial: 'comment_form', locals: {comment: comment, test_hash: comment.test_hash } %>
<% end %>

View File

@ -1,7 +1,7 @@
<% if comment.id.nil? %>
<%= form_for comment, url: admin_create_comment_path(test_hash: test_hash), method: :post do |form| %>
<div class="form-group">
<div>
<%= form.label :message, "New Comment" %>
<%= form.text_area :message %>
</div>
@ -12,7 +12,7 @@
<% else %>
<%= form_for comment, url: admin_update_comment_path(test_hash: test_hash, id: comment.id), method: :post do |form| %>
<div class="form-group">
<div>
<%= form.label :message, "Update Comment" %>
<%= form.text_area :message %>
</div>

View File

@ -1,7 +1,5 @@
<% # TODO: This should be extracted into a decorator, or something. It is only a quick hack solution. %>
<% if current_user.acts_as_reviewer? %>
<div class="review_meta__votes" data-id="vote-count">
<div data-id="vote-count">
<strong>Votes: </strong>
<% if @candidate.pending? && current_user.commented_on?(@candidate.test_hash) %>
@ -27,7 +25,7 @@
<% end %>
<% if current_user.acts_as_manager? %>
<div class="review_meta__vetos">
<div>
<%= form_tag admin_interview_path(test_hash: @candidate.test_hash) do %>
<strong>Interview: </strong>
@ -37,7 +35,7 @@
<%= radio_button_tag :review_status, :declined, checked = @candidate.declined? %>
<%= label_tag :review_status_declined, "No" %>
<div class="review-status-comments">
<div>
<span>Review comments for recruiter</span>
<%= text_area_tag :review_comments, @candidate.review_comments %>
<%= submit_tag 'Send Request' %>

View File

@ -2,27 +2,27 @@
content_for :section_title, "Completed Tests"
content_for :title, "Quiz Results - Skills Assessment Admin"
%>
<main class="summary_tpl">
<table cellspacing="0" cellpadding="0">
<tr>
<th><%= sortable "test_hash", "Test ID" %></th>
<th><%= sortable "name" %></th>
<th><%= sortable "project", "Client/Project" %></th>
<th>Recruiter</th>
<th><%= sortable "completed_at", "Submitted on" %></th>
<th>Interview?</th>
</tr>
<% @candidates.each do |candidate| %>
<tr>
<td><%= link_to candidate.test_hash, admin_result_path(candidate.test_hash) %></td>
<td><%= candidate.name if !candidate.pending? %></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>
</tr>
<% end %>
</table>
<%= paginate @candidates %>
</main>
<table cellspacing="0" cellpadding="0">
<tr>
<th><%= sortable "test_hash", "Test ID" %></th>
<th><%= sortable "name" %></th>
<th><%= sortable "project", "Client/Project" %></th>
<th>Recruiter</th>
<th><%= sortable "completed_at", "Submitted on" %></th>
<th>Interview?</th>
</tr>
<% @candidates.each do |candidate| %>
<tr>
<td><%= link_to candidate.test_hash, admin_result_path(candidate.test_hash) %></td>
<td><%= candidate.name if !candidate.pending? %></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>
</tr>
<% end %>
</table>
<%= paginate @candidates %>

View File

@ -2,65 +2,47 @@
content_for :title, "Quiz Review - Skills Assessment Admin"
%>
<div class="summary_tpl">
<div class="admin-review">
<h2 class="prft-heading">Quiz Review</h2>
<div>
<h1>Quiz Review</h1>
<div class="review_meta">
<div>
<% unless @candidate.pending? %>
<strong>Name:</strong> <%= @candidate.name %><br />
<% end %>
<strong>Test ID:</strong> <%= @candidate.test_hash %><br />
<strong>Years of Experience:</strong> <%= @candidate.experience %><br />
<strong>Client/Project:</strong> <%= @candidate.project %><br />
<strong>Position Type:</strong> <%= @candidate.position %><br />
<strong>Skill Needs:</strong> <%= @candidate.skill_needs %><br />
<strong>Recruiter Email:</strong> <%= mail_to @candidate.recruiter.name, @candidate.recruiter.email %><br />
</div>
</div>
<% @quiz.each do |question| %>
<%= form_for(:answer, url: '#never-post', html:{id: 'summary-form'}) do |form| %>
<article class="answer-sec <%= question.input_type %>-type" data-qid="<%= question.question_id %>">
<div class="question-heading">
<div class="question-title">
<h3><%= question.question %></h3>
</div>
</div>
<div class="answer-container">
<% if question.attachment.present? %>
<%= image_tag question.attachment %>
<% end %>
<fieldset disabled class="answer-block">
<%= render partial: "quiz/#{question.input_type}", locals: {question: question, answer: question.answer, form: form} %>
</fieldset>
</div>
</article>
<% end #form_tag %>
<% end #questions loop %>
<%= link_to(admin_results_path, { class: 'secondary-btn' }) do %>
<button>Back to list</button>
<div>
<% unless @candidate.pending? %>
<strong>Name:</strong> <%= @candidate.name %><br />
<% end %>
<strong>Test ID:</strong> <%= @candidate.test_hash %><br />
<strong>Years of Experience:</strong> <%= @candidate.experience %><br />
<strong>Client/Project:</strong> <%= @candidate.project %><br />
<strong>Position Type:</strong> <%= @candidate.position %><br />
<strong>Skill Needs:</strong> <%= @candidate.skill_needs %><br />
<strong>Recruiter Email:</strong> <%= mail_to @candidate.recruiter.name, @candidate.recruiter.email %><br />
</div>
<div class="review-comments">
<div>
<h2 class="prft-heading">Voting</h2>
<div class="review_meta">
<div><%= render partial: 'voting' %></div>
</div>
</div>
<% @quiz.each do |question| %>
<%= form_for(:answer, url: '#never-post', html:{id: 'summary-form'}) do |form| %>
<h2><%= question.question %></h2>
<%= image_tag question.attachment if question.attachment.present? %>
<div>
<h2 id="comment-header" class="prft-heading">Comments</h2>
<% if policy(QuizComment).new? %>
<%= render partial: 'comment_form', locals: {comment: @comment, test_hash: @candidate.test_hash } %>
<% end %>
<%= render partial: 'comment', collection: @comments, locals: { test_hash: @candidate.test_hash } %>
<a href="#comment-header">Back to top</a>
</div>
<fieldset disabled>
<%= render partial: "quiz/#{question.input_type}", locals: {question: question, answer: question.answer, form: form} %>
</fieldset>
<% end %>
<% end %>
<%= link_to("Back to list", admin_results_path, { class: "" }) %>
</div>
<div>
<div>
<h1>Voting</h1>
<div><%= render partial: 'voting' %></div>
</div>
<div>
<h1 id="comment-header">Comments</h1>
<% if policy(QuizComment).new? %>
<%= render partial: 'comment_form', locals: {comment: @comment, test_hash: @candidate.test_hash } %>
<% end %>
<%= render partial: 'comment', collection: @comments, locals: { test_hash: @candidate.test_hash } %>
<a href="#comment-header">Back to top</a>
</div>
</div>

View File

@ -1,33 +1,37 @@
<%= render partial: 'shared/form_model_errors', locals: { obj: user} %>
<%= form_for user, url: action do |form| %>
<div class="form-group">
<div>
<%= form.label :name, "Full Name" %>
<%= form.text_field :name %>
</div>
<div class="form-group">
<div>
<%= form.label :email, "eMail" %>
<%= form.email_field :email %>
</div>
<div class="form-group">
<div>
<%= form.label :role, "Role" %>
<%= form.select :role, admin_role_options(user.role), include_blank: false %>
</div>
<div class="form-group">
<div>
<div><strong>Quiz Review List</strong></div>
<p>
Quizzes this user should be reviewing the results of.<br />
Admins and Recruiters should not have any checked, unless they are expected
to participate in the technical review for that quiz.
</p>
<%= form.collection_check_boxes(:quiz_ids, Quiz.all, :id, :name, {}, {class: 'checkbox'}) do | quiz | %>
<div class="form-group-multiples">
<%= quiz.check_box( checked: user.quizzes.include?(quiz.object)) %>
<%= quiz.label %>
</div>
<% end %>
<ul>
<%= form.collection_check_boxes(:quiz_ids, Quiz.all, :id, :name, {}, {class: ""}) do | quiz | %>
<li>
<%= quiz.check_box( checked: user.quizzes.include?(quiz.object)) %>
<%= quiz.label %>
</li>
<% end %>
</ul>
</div>
<%= form.submit %>

View File

@ -11,7 +11,7 @@
<td><%= link_to user.name, admin_user_path(user.to_i) %></td>
<td><%= mail_to(user.email) %></td>
<td><%= user.role %></td>
<td><%= link_to 'edit', admin_edit_user_path(user.to_i), { class: 'btn tertiary-btn' } if policy(user).edit? %></td>
<td><%= link_to 'edit', admin_edit_user_path(user.to_i), { class: "" } if policy(user).edit? %></td>
</tr>
<% end %>
</table>

View File

@ -1,5 +1,3 @@
<%
content_for :section_title, "Edit: #{@user.name}"
%>
<% content_for :section_title, "Edit: #{@user.name}" %>
<%= render partial: 'form', locals: {user: @user, action: admin_update_user_path } %>

View File

@ -1,7 +1,7 @@
<%
content_for :section_title, "Users"
%>
<% content_for :section_title, "Users" %>
<h1>Users</h1>
<%= render partial: 'admin/user/table_list', locals: { users: @users } %>
<%= link_to('New User', admin_new_user_path, { class: 'btn' }) if policy(User).create? %>
<%= link_to('New User', admin_new_user_path, { class: "" }) if policy(User).create? %>

View File

@ -1,5 +1,3 @@
<%
content_for :section_title, "New User"
%>
<% content_for :section_title, "New User" %>
<%= render partial: 'form', locals: {user: @user, action: admin_create_user_path } %>

View File

@ -1,16 +1,14 @@
<%
content_for :section_title, "#{@user.name}"
%>
<% content_for :section_title, "#{@user.name}" %>
<p><%= @user.name %></p>
<p><%= mail_to(@user.email) %></p>
<p><%= @user.role %></p>
<div><%= @user.name %></div>
<div><%= mail_to(@user.email) %></div>
<div><%= @user.role %></div>
<p>Quizzes:</p>
<div>Quizzes:</div>
<ul>
<% @user.quizzes.each do |quiz| %>
<li><%= quiz.name %></li>
<% end %>
</ul>
<%= link_to('Edit', admin_edit_user_path(@user.to_i), { class: 'btn' }) %>
<%= link_to('Edit', admin_edit_user_path(@user.to_i), { class: "" }) %>

View File

@ -1,20 +1,14 @@
<% content_for :title, "Skills Assessment" %>
<main class="intro_tpl">
<h1 class="prft-heading">Let's Get Started</h1>
<p>
Hey there! Give us your Test ID, and we'll get you started.
</p>
<h1>Let's Get Started</h1>
<%= form_tag(validate_candidate_path) do %>
<div class="form-group">
<label for="userid">What's your Test ID?</label>
<input type="text" id="test_id" name="test_id" required/>
<p>Hey there! Give us your Test ID, and we'll get you started.</p>
<% if flash[:error].present? %>
<div class="error"><%= flash[:error] %></div>
<% end %>
</div>
<button type="submit">Log in</button>
<% end %>
</main>
<%= form_tag(validate_candidate_path) do %>
<%= render partial: "shared/generic_flash" %>
<label for="test_id">What's your Test ID?</label>
<input type="text" id="test_id" name="test_id" required />
<button type="submit">Log in</button>
<% end %>

View File

@ -1,11 +1,10 @@
<% content_for :title, "Skills Assessment" %>
<main class="intro_tpl">
<h1 class="prft-heading">Oops!</h1>
<p>
Looks like you hit the browser's Back button. You can't go backwards in the test,
but you'll have a chance at the end to review your answers and make changes.
</p>
<h1>Oops!</h1>
<a href="<%= question_path %>"><button>Continue Test</button></a>
</main>
<p>
Looks like you hit the browser's Back button. You can't go backwards in the test,
but you'll have a chance at the end to review your answers and make changes.
</p>
<%= link_to "Continue Test", question_path, {class: ""} %>

View File

@ -1,11 +1,8 @@
<% content_for :title, "Saved! - Skills Assessment" %>
<main class="styleguide_tpl">
<p>
Your test results have been saved. You can visit again later with your Test ID to complete
the test starting from where you left off.
</p>
<div class="button-wrap">
<a class="btn primary-btn" href="<%= question_path %>">Return to test</a>
</div>
</main>
<p>
Your test results have been saved. You can visit again later with your Test ID to complete
the test starting from where you left off.
</p>
<%= link_to "Return to test", question_path, {class: ""} %>

View File

@ -1,8 +1,8 @@
<% content_for :title, "Thank You - Skills Assessment" %>
<main class="styleguide_tpl">
<h1>Thank you!</h1>
<p>
Your answers have been submitted. We will review and your recruiter
will be in touch.
</p>
</main>
<h1>Thank you!</h1>
<p>
Your answers have been submitted.
We will review and your recruiter will be in touch.
</p>

View File

@ -1,26 +1,25 @@
<% content_for :title, "Skills Assessment" %>
<main class="intro_tpl">
<h1 class="prft-heading">Welcome!</h1>
<p>
This is a skills assessment test. It's the first step in the process of interviewing
for a Front-End Development position with Perficient Digital.
</p>
<p>
The questions will test your knowledge in the areas of HTML, CSS, and JavaScript.
Please note that you can <strong>only move forward through the test</strong>, not back,
and you <strong>must attempt to answer the question</strong> before moving to the
next one. You'll have an opportunity at the end of the test to review and update your
answers if need be. At any time, you may save your progress and log back in to continue
taking the test from where you left off.
</p>
<p>
Please answer to the best of your ability&mdash;it's totally okay to say
"I don't know"!&mdash;and above all, relax and have fun! Once you submit your
answers, we will review your assessment and your recruiter will be in touch.
</p>
<h1>Welcome!</h1>
<div class="button-wrap">
<%= link_to "Begin", question_path, {class: 'btn'} %>
</div>
</main>
<p>
This is a skills assessment test. It's the first step in the process of interviewing
for a Front-End Development position with Perficient Digital.
</p>
<p>
The questions will test your knowledge in the areas of HTML, CSS, and JavaScript.
Please note that you can <strong>only move forward through the test</strong>, not back,
and you <strong>must attempt to answer the question</strong> before moving to the
next one. You'll have an opportunity at the end of the test to review and update your
answers if need be. At any time, you may save your progress and log back in to continue
taking the test from where you left off.
</p>
<p>
Please answer to the best of your ability&mdash;it's totally okay to say
"I don't know"!&mdash;and above all, relax and have fun! Once you submit your
answers, we will review your assessment and your recruiter will be in touch.
</p>
<%= link_to "Begin", question_path, {class: ""} %>

View File

@ -1,16 +1,7 @@
<% content_for :title, "Skills Assessment" %>
<main class="intro_tpl">
<h1 class="prft-heading">Welcome Back</h1>
<h1>Welcome Back</h1>
<p>Hello, <%= current_candidate.name %>!</p>
<p>We are ready to pick up where you left off.</p>
<p>Hello, <%= current_candidate.name %>!</p>
<p>
We are ready to pick up where you left off.
</p>
<div class="btn-return">
<%= link_to "Return to Test", question_path, { class: "btn primary-btn" } %>
</div>
</main>
<%= link_to "Return to Test", question_path, { class: "" } %>

View File

@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="en" class="no-js">
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
@ -10,43 +11,29 @@
<!--[if ! lte IE 8]><!-->
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<!--<![endif]-->
<!--[if lt IE 9]>
<%= javascript_include_tag 'ie9' %>
<![endif]-->
</head>
<body>
<div class="layout">
<header>
<% if content_for?(:section_title) %>
<div><%= yield(:section_title) %></div>
<% else %>
<div>Skills Assessment Admin</div>
<% end %>
</header>
<header class="no-progressbar admin">
<%= render partial: "admin/nav" if current_user %>
<div class="page-title slash-left">
<% if content_for?(:section_title) %>
<div><%= yield(:section_title) %></div>
<% else %>
<div>Skills Assessment Admin</div>
<% end %>
</div>
</header>
<%= render partial: "admin/nav" if current_user %>
<main class="<%= content_for?(:main_class) ? yield(:main_class) : "admin_tpl" %>">
<%= render partial: "shared/generic_flash" %>
<%= yield %>
</main>
<%= render partial: "shared/generic_flash" %>
</div>
<%= yield %>
<footer>
<div class="footer_title">&nbsp;</div>
<div class="pd_logo"><%= image_tag("perficientdigital.png", alt:"Perficient Digital") %></div>
<div class="footer_yellow-bar slantleft slantright">&nbsp;</div>
<div><%= image_tag("perficientdigital.png", alt:"Perficient Digital") %></div>
</footer>
<!--[if ! lte IE 8]><!-->
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
<%= javascript_include_tag 'admin', 'data-turbolinks-track': 'reload' %>
<%= yield :custom_javascipt %>
<!--<![endif]-->
</body>

View File

@ -1,6 +1,6 @@
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
@ -11,49 +11,39 @@
<!--[if ! lte IE 8]><!-->
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<!--<![endif]-->
<!--[if lt IE 9]>
<%= javascript_include_tag 'ie9' %>
<![endif]-->
</head>
<body>
<div class="layout">
<header <%= "class=no-progressbar" unless content_for?(:progress) %>>
<div class="page-title slash-left">
<% if content_for?(:category) %>
<div>Section: <%= yield(:category) %></div>
<% else %>
<div>Skills Assessment Test</div>
<% end %>
</div>
</header>
<%= yield %>
<% if content_for?(:progress) %>
<div class="progress ignore-margin">
<div class="progress-bar" role="progressbar" aria-valuenow="<%= yield :progress %>"
aria-valuemin="0" aria-valuemax="100" style="width: <%= yield :progress %>%">
<span><%= yield :progress %>%</span>
</div>
</div>
<header>
<% if content_for?(:category) %>
<div>Section: <%= yield(:category) %></div>
<% else %>
<div>Skills Assessment Test</div>
<% end %>
</header>
</div>
<main>
<%= yield %>
</main>
<footer>
<div class="footer_title"><h2><%= yield(:footer_title) %></h2></div>
<div class="pd_logo"><%= image_tag("perficientdigital.png", alt:"Perficient Digital") %></div>
<div class="footer_yellow-bar slantleft slantright">&nbsp;</div>
<% if content_for?(:progress) %>
<aside role="progressbar"
style="width: <%= yield :progress %>%"
aria-valuemin="0"
aria-valuemax="100"
aria-valuenow="<%= yield :progress %>">
<span><%= yield :progress %>%</span>
</aside>
<% end %>
<footer role="contentinfo">
<div><%= yield(:footer_title) %></div>
<div><%= image_tag("perficientdigital.png", alt:"Perficient Digital") %></div>
</footer>
<!--[if ! lte IE 8]><!-->
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
<%= yield :custom_javascipt %>
<!--<![endif]-->
</body>
</html>

View File

@ -1,15 +1,14 @@
<% answers = Array(question.answer) %>
<%= form.collection_check_boxes(:answer_array, question.input_options, :to_s, :to_s, {}, {class: 'checkbox'}) do | option | %>
<%= form.collection_check_boxes(:answer_array, question.input_options, :to_s, :to_s, {}, {class: ""}) do | option | %>
<%
option_id = "#{question.question_id}#{sanitize_to_id(option.value)}"
checked = answers.include?(option.value) ? 'checked' : ''
%>
<div class="form-group-multiples">
<div class="">
<%= option.check_box( id: option_id, checked: checked, data: { last: checked } ) %>
<%= option.label(for: option_id) %>
</div>
<% end %>
<%= render partial: "quiz/answer_errors", locals: {question: question, answer: answer} %>

View File

@ -4,20 +4,20 @@
question.input_options.each do | option |
option_id = "#{option.parameterize}_#{question.to_i}"
checkbox_html = {class: 'checkbox', id: option_id, data: { last: answers.include?(option) ? 'checked' : '' } }
checkbox_html = {class: "", id: option_id, data: { last: answers.include?(option) ? 'checked' : '' } }
%>
<div class="form-group-multiples">
<div class="">
<%= check_box_tag('answer[answer_hash][options][]', option, answers.include?(option), checkbox_html) %>
<%= label_tag(option_id, option) %>
</div>
<%
end %>
<div class="form-group-multiples">
<div class="">
<%
option_id = "other_#{question.to_i}"
checkbox_html = {class: 'checkbox', id: option_id, data: { last: answers.include?('other') ? 'checked' : '' } }
text_html = {class: 'input-other', id: "text_#{option_id}", data: { last: other_value }}
checkbox_html = {class: "", id: option_id, data: { last: answers.include?('other') ? 'checked' : '' } }
text_html = {class: "", id: "text_#{option_id}", data: { last: other_value }}
%>
<%= check_box_tag('answer[answer_hash][options][]', 'other', answers.include?('other'), checkbox_html) %>
<%= label_tag(option_id, 'Other') %>

View File

@ -1,14 +1,15 @@
<% answer_string = answer.try(:answer) || answer %>
<%= form.collection_radio_buttons(:answer, question.input_options, :to_s, :to_s, {}, {class: 'radio'}) do | option | %>
<%
option_id = "#{question.question_id}#{sanitize_to_id(option.value)}"
checked = answer_string == option.value ? 'checked' : ''
%>
<%= form.collection_radio_buttons(:answer, question.input_options, :to_s, :to_s, {}, {class: ""}) do | option | %>
<div class="form-group-multiples">
<%= option.radio_button( id: option_id, checked: checked, data: { last: checked } ) %>
<%= option.label(for: option_id) %>
</div>
<%
option_id = "#{question.question_id}#{sanitize_to_id(option.value)}"
checked = answer_string == option.value ? 'checked' : ''
%>
<div class="">
<%= option.radio_button( id: option_id, checked: checked, data: { last: checked } ) %>
<%= option.label(for: option_id) %>
</div>
<% end %>

View File

@ -4,20 +4,20 @@
question.input_options.each do | option |
option_id = "#{option.parameterize}_#{question.to_i}"
radio_html = {class: 'radio', id: option_id, data: {last: (answer_string == option) ? 'checked' : '' }}
radio_html = {class: "", id: option_id, data: {last: (answer_string == option) ? 'checked' : '' }}
%>
<div class="form-group-multiples">
<div class="">
<%= radio_button_tag('answer[answer_hash][options][]', option, (answer_string == option), radio_html) %>
<%= label_tag(option_id, option) %>
</div>
<%
end %>
<div class="form-group-multiples">
<div class="">
<%
option_id = "other_#{question.to_i}"
radio_html = {class: 'radio', id: option_id, data: { last: answer_string }}
text_html = {class: 'input-other', id: "text_#{option_id}", data: { last: other_value }}
radio_html = {class: "", id: option_id, data: { last: answer_string }}
text_html = {class: "", id: "text_#{option_id}", data: { last: other_value }}
%>
<%= radio_button_tag('answer[answer_hash][options][]', 'other', (answer_string == 'other'), radio_html) %>
<%= label_tag option_id, 'Other' %>

View File

@ -3,6 +3,6 @@
<label for="answer_answer">Enter answer here</label>
<%= text_area_tag 'answer[answer]', answer_string, {rows: 10, data: { last: answer_string } } %>
<div class="chars <%= params[:action] == 'summary' ? 'hidden' : '' %>">Characters remaining: <span></span></div>
<div class="<%= params[:action] == 'summary' ? 'hidden' : '' %>">Characters remaining: <span></span></div>
<%= render partial: "quiz/answer_errors", locals: {question: question, answer: answer} %>

View File

@ -6,34 +6,19 @@
%>
<%= form_for(@answer, url: post_answer_path(@answer.id), html:{method: :post, id: 'answer-form', data: {qid: @question.question_id}}) do |form| %>
<main class="answer-sec <%= @question.input_type %>-type questions_tpl" data-qid="<%= @question.question_id %>">
<h2 class="question-text"><%= @question.question %></h2>
<% if @question.attachment.present? %>
<%= image_tag @question.attachment %>
<% end %>
<div><%= @question.question %></div>
<%= image_tag @question.attachment if @question.attachment.present? %>
<div class="content-well">
<%= hidden_field_tag 'answer[question_id]', @question.question_id %>
<%= hidden_field_tag 'answer[answer_id]', @question.answer_id %>
<%= render partial: @question.input_type, locals: {question: @question, form: form, answer: @answer } %>
</div>
<%= render partial: @question.input_type, locals: {question: @question, form: form, answer: @answer } %>
<% if @status.on_summary %>
<% if @status.on_summary %>
<button type="submit" name="submit">Save and return to summary</button>
<% else %>
<button type="submit" name="save">Save</button>
<button type="submit" name="submit">Next &rarr;</button>
<% end %>
<div class="btn-container-summary button-wrap">
<input type="submit" name="submit" value="Save and return to summary">
</div>
<% else %>
<div class="btn-container-left">
<input type="submit" class="secondary-btn" name="save" value="Save">
</div>
<div class="btn-container-right">
<input type="submit" class="tertiary-btn arrow-btn-right" name="submit" value="Next &rarr;">
</div>
<% end %>
</main>
<%= hidden_field_tag 'answer[question_id]', @question.question_id %>
<%= hidden_field_tag 'answer[answer_id]', @question.answer_id %>
<% end %>

View File

@ -7,49 +7,40 @@
end
%>
<main class="summary_tpl">
<h2 class="prft-heading">Almost done!</h2>
<p>
Now's the time to review your answers and go back and change any, if you need to.
Once you're done, hit the button at the bottom of the page to submit your answers.
</p>
<h1>Almost done!</h1>
<p>
Now's the time to review your answers and go back and change any, if you need to.
Once you're done, hit the button at the bottom of the page to submit your answers.
</p>
<hr>
<hr>
<% @quiz.each do |question| %>
<%= form_for(:answer, remote: true, url: post_answer_path(answer_id: question.answer_id), html:{class: 'summary-form'}) do |form| %>
<article class="answer-sec">
<div class="question-heading">
<div class="question-title">
<h3><%= question.question %></h3>
</div>
<div class="answer-buttons">
<a href="<%= question_path(question.question_id) %>" class="tertiary-btn button-edit">Edit</a>
<button class="tertiary-btn button-save">Save</button>
<button class="tertiary-btn button-cancel">Cancel</button>
</div>
</div>
<% @quiz.each do |question| %>
<%= form_for(:answer, remote: true, url: post_answer_path(answer_id: question.answer_id), html:{class: ""}) do |form| %>
<h2><%= question.question %></h2>
<div class="answer-container">
<% if question.attachment.present? %>
<%= image_tag question.attachment %>
<% end %>
<div>
<%= link_to('Edit', question_path(question.question_id)) %>
<button>Save</button>
<button>Cancel</button>
</div>
<fieldset disabled class="answer-block">
<%= hidden_field_tag 'answer[question_id]', question.question_id %>
<%= hidden_field_tag 'answer[answer_id]', question.answer_id %>
<%= hidden_field_tag 'submit', true %>
<%= render partial: question.input_type, locals: {question: question, form: form, answer: question.answer} %>
</fieldset>
</div>
</article>
<% end %>
<%= image_tag question.attachment if question.attachment.present? %>
<fieldset disabled>
<%= render partial: question.input_type, locals: {question: question, form: form, answer: question.answer} %>
</fieldset>
<%= hidden_field_tag 'answer[question_id]', question.question_id %>
<%= hidden_field_tag 'answer[answer_id]', question.answer_id %>
<%= hidden_field_tag 'submit', true %>
<% end %>
<% end %>
<%= form_tag post_summary_path, id: 'summary-submit', class: "btn-center" do %>
<% unless @status.can_submit %>
<div class="error">Sorry, you must answer all questions before you can submit.</div>
<% end %>
<%= submit_tag "Submit all answers", {class: 'submit-button', disabled: !@status.can_submit } %>
<%= form_tag post_summary_path, id: 'summary-submit', class: "" do %>
<% unless @status.can_submit %>
<div class="error">Sorry, you must answer all questions before you can submit.</div>
<% end %>
</main>
<%= submit_tag "Submit all answers", {class: "", disabled: !@status.can_submit } %>
<% end %>

View File

@ -1,10 +1,8 @@
<% if flash[:error].present? %>
<div class="error">
<%= flash[:error] %>
<p>
<% obj.errors.messages.each do |k,v| %>
<%= "#{k.to_s} #{v.join(' and ')}" %><br />
<% end %>
</p>
<% obj.errors.messages.each do |k,v| %>
<div><%= "#{k.to_s} #{v.join(' and ')}" %></div>
<% end %>
</div>
<% end %>

View File

@ -64,7 +64,7 @@ module Admin
assert_redirected_to admin_question_path(question.to_i)
get admin_question_path question.to_i
assert_select 'p', 'foo bar baz'
assert_select 'div', 'foo bar baz'
end
test "should post attachment" do

View File

@ -40,7 +40,7 @@ module Admin
quiz = quizzes :fed
get admin_quiz_url quiz.to_i
assert_response :success
assert_select 'p', quiz.dept
assert_select 'div', quiz.dept
end
test "should get edit" do
@ -56,7 +56,7 @@ module Admin
assert_redirected_to admin_quiz_path(quiz.to_i)
get admin_quiz_path quiz.to_i
assert_select 'p', 'another'
assert_select 'div', 'another'
end
test "should fail to update quiz" do

View File

@ -44,7 +44,7 @@ module Admin
user = users(:recruiter)
get admin_user_url user.to_i
assert_response :success
assert_select 'p', user.name
assert_select 'div', user.name
end
test "should get edit" do
@ -62,7 +62,7 @@ module Admin
assert_redirected_to admin_user_path(user.to_i)
get admin_user_url user.to_i
assert_select 'p', 'new name'
assert_select 'div', 'new name'
end
test "should fail to update user" do

View File

@ -36,14 +36,14 @@ class CandidateControllerTest < ActionDispatch::IntegrationTest
auth_candidate candidates(:martha)
get welcome_path
assert_select '.prft-heading', "Welcome!"
assert_select 'h1', "Welcome!"
end
test "should display welcome back view" do
auth_candidate candidates(:roy)
get welcome_path
assert_select '.prft-heading', "Welcome Back"
assert_select 'h1', "Welcome Back"
end
test "should redirect to thankyou when completed" do

View File

@ -7,7 +7,7 @@ class QuestionAttachmentsTest < ActionDispatch::IntegrationTest
get question_path questions(:fed6)
assert_response :success
assert_select '.question-text', questions(:fed6).question
assert_select 'div', questions(:fed6).question
assert_select "img[src=\"#{questions(:fed6).attachment}\"]"
end

View File

@ -7,7 +7,7 @@ class QuestionFlowTest < ActionDispatch::IntegrationTest
get question_path
assert_response :success
assert_select '.question-text', questions(:fed1).question
assert_select 'div', questions(:fed1).question
end
test "should load the summary" do
@ -15,7 +15,7 @@ class QuestionFlowTest < ActionDispatch::IntegrationTest
get summary_path
assert_response :success
assert_select '.prft-heading', 'Almost done!'
assert_select 'h1', 'Almost done!'
end
test "can load specific question from summary" do
@ -24,7 +24,7 @@ class QuestionFlowTest < ActionDispatch::IntegrationTest
get question_path(question.id)
assert_response :success
assert_select '.question-text', question.question
assert_select 'div', question.question
end
test 'juan should be on summary with 80% complete' do
@ -32,6 +32,6 @@ class QuestionFlowTest < ActionDispatch::IntegrationTest
get summary_path
assert_response :success
assert_select '.progress span', '80%'
assert_select 'aside span', '80%'
end
end

View File

@ -8,7 +8,7 @@ class QuestionLiveCoderTest < ActionDispatch::IntegrationTest
get question_path(question.id)
assert_response :success
assert_select '.question-text', question.question
assert_select 'div', question.question
end
test "should load seed data into live coder" do