adds poll and poll question's specs

This commit is contained in:
rgarcia
2016-11-17 22:48:00 +01:00
parent 626a8e9154
commit 4955daf886
6 changed files with 136 additions and 21 deletions

View File

@@ -11,8 +11,8 @@ class Polls::QuestionsController < ApplicationController
@comment_tree = CommentTree.new(@commentable, params[:page], @current_order)
set_comment_flags(@comment_tree.comments)
#@question_answer = @question.answers.where(author_id: current_user.try(:id)).first
@answers_by_question_id = {@question.id => params[:answer]}
question_answer = @question.partial_results.where(author_id: current_user.try(:id)).first
@answers_by_question_id = {@question.id => question_answer.try(:answer)}
end
def answer