From c683f124b283ac36d22462f6bab1c3fde6ae46c5 Mon Sep 17 00:00:00 2001 From: Michel Felipe de Oliveira Ferreira Date: Thu, 28 Jan 2016 11:43:15 -0300 Subject: [PATCH] Update Gem 'will_paginate' that contains fix Rails 4 distinct count with multiple fields --- Gemfile | 2 +- plugins/relevant_content/test/unit/relevant_content_block_test.rb | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index d54cc7f..ef4a648 100644 --- a/Gemfile +++ b/Gemfile @@ -18,7 +18,7 @@ gem 'ruby-feedparser', '~> 0.7' gem 'daemons', '~> 1.1' gem 'unicorn', '~> 4.8' gem 'nokogiri', '~> 1.6.0' -gem 'will_paginate', '~> 3.0.5.0' +gem 'will_paginate', '~> 3.0.7' gem 'pothoven-attachment_fu', '~> 3.2.16' gem 'delayed_job' gem 'delayed_job_active_record' diff --git a/plugins/relevant_content/test/unit/relevant_content_block_test.rb b/plugins/relevant_content/test/unit/relevant_content_block_test.rb index a3eb1cb..920cbce 100644 --- a/plugins/relevant_content/test/unit/relevant_content_block_test.rb +++ b/plugins/relevant_content/test/unit/relevant_content_block_test.rb @@ -57,4 +57,24 @@ class RelevantContentBlockTest < ActiveSupport::TestCase end end + should 'check most voted articles from profile with relevant content block' do + community = fast_create(Community) + article = fast_create(Article, {:name=>'2 votes', :profile_id => community.id}) + 2.times{ + person = fast_create(Person) + person.vote_for(article) + } + article = fast_create(Article, {:name=>'10 votes', :profile_id => community.id}) + 10.times{ + person = fast_create(Person) + person.vote_for(article) + } + + Box.create!(owner: community) + community.boxes[0].blocks << RelevantContentPlugin::RelevantContentBlock.new + + data = Article.most_voted(community, 5) + assert_equal false, data.empty? + end + end -- libgit2 0.21.2