[Git][noosfero/noosfero][master] statistics: fix optional dependency on products plugin

Bráulio Bhavamitra gitlab at mg.gitlab.com
Fri May 13 19:02:20 BRT 2016


Bráulio Bhavamitra pushed to branch master at Noosfero / noosfero


Commits:
e9d19fcf by Braulio Bhavamitra at 2016-05-13T18:56:06-03:00
statistics: fix optional dependency on products plugin

- - - - -


1 changed file:

- plugins/statistics/test/unit/statistics_block_test.rb


Changes:

=====================================
plugins/statistics/test/unit/statistics_block_test.rb
=====================================
--- a/plugins/statistics/test/unit/statistics_block_test.rb
+++ b/plugins/statistics/test/unit/statistics_block_test.rb
@@ -1,4 +1,5 @@
 require_relative '../test_helper'
+
 class StatisticsBlockTest < ActiveSupport::TestCase
 
   ['user_counter', 'tag_counter', 'comment_counter'].map do |counter|
@@ -140,6 +141,8 @@ class StatisticsBlockTest < ActiveSupport::TestCase
   end
 
   should 'return the amount of visible environment products' do
+    return unless defined? ProductsPlugin
+
     b = StatisticsBlock.new
     e = fast_create(Environment)
 
@@ -160,6 +163,8 @@ class StatisticsBlockTest < ActiveSupport::TestCase
   end
 
   should 'return the amount of visible enterprise products' do
+    return unless defined? ProductsPlugin
+
     b = StatisticsBlock.new
 
     e = fast_create(Enterprise)



View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/e9d19fcfb276a892208ccab53f317da5d4fedee3
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20160513/0247fde1/attachment-0001.html>


More information about the Noosfero-dev mailing list