progress on #27: test coverage over 96%

This commit is contained in:
Mark Moser
2016-08-16 17:09:40 -05:00
parent c7111ad7ad
commit 14bbd301ed
8 changed files with 125 additions and 11 deletions

View File

@ -109,10 +109,4 @@ class QuizController < ApplicationController
saved: params.key?(:save),
submitted: params.key?(:submit))
end
def process_live_code_text
@answer.update(answer: answer_params[:live_code_text].to_h,
saved: params.key?(:save),
submitted: params.key?(:submit))
end
end

View File

@ -37,6 +37,9 @@ class Candidate < ApplicationRecord
"#{my_status.progress}%"
end
# FIXME: This feels wrong here. Mail deliveries should be in controller.
# Privatize in QuizController
# also, bang methods in ruby do an action and replace, or return nil
def complete!
if update_attributes(completed: true)
CandidateMailer.submitted(self).deliver_now