diff --git a/app/models/question.rb b/app/models/question.rb index 9d261ac..9406624 100644 --- a/app/models/question.rb +++ b/app/models/question.rb @@ -690,7 +690,7 @@ class Question < ActiveRecord::Base UNION ALL (SELECT skipper_id vid FROM skips WHERE question_id = #{id}) ) b GROUP BY b.vid ORDER BY total - "), true) || 0 + "), true) || nil end def upload_to_participation_ratio diff --git a/spec/integration/questions_spec.rb b/spec/integration/questions_spec.rb index 92a565c..17a00c1 100644 --- a/spec/integration/questions_spec.rb +++ b/spec/integration/questions_spec.rb @@ -285,6 +285,9 @@ describe "Questions" do before(:all) { truncate_all } it "should return the median responses per session" do q = Factory.create(:aoi_question, :site => @api_user) + get_auth median_responses_per_session_question_path(q, :format => 'xml') + response.should be_success + response.body.should have_tag("median[nil=true]", :text => "") Factory.create(:vote_new_user, :question => q) v = Factory.create(:vote_new_user, :question => q) Factory.create(:vote, :question => q, :voter => v.voter) -- libgit2 0.21.2