Commit e9d19fcfb276a892208ccab53f317da5d4fedee3

Authored by Braulio Bhavamitra
1 parent 5bed328d

statistics: fix optional dependency on products plugin

plugins/statistics/test/unit/statistics_block_test.rb
1 require_relative '../test_helper' 1 require_relative '../test_helper'
  2 +
2 class StatisticsBlockTest < ActiveSupport::TestCase 3 class StatisticsBlockTest < ActiveSupport::TestCase
3 4
4 ['user_counter', 'tag_counter', 'comment_counter'].map do |counter| 5 ['user_counter', 'tag_counter', 'comment_counter'].map do |counter|
@@ -140,6 +141,8 @@ class StatisticsBlockTest &lt; ActiveSupport::TestCase @@ -140,6 +141,8 @@ class StatisticsBlockTest &lt; ActiveSupport::TestCase
140 end 141 end
141 142
142 should 'return the amount of visible environment products' do 143 should 'return the amount of visible environment products' do
  144 + return unless defined? ProductsPlugin
  145 +
143 b = StatisticsBlock.new 146 b = StatisticsBlock.new
144 e = fast_create(Environment) 147 e = fast_create(Environment)
145 148
@@ -160,6 +163,8 @@ class StatisticsBlockTest &lt; ActiveSupport::TestCase @@ -160,6 +163,8 @@ class StatisticsBlockTest &lt; ActiveSupport::TestCase
160 end 163 end
161 164
162 should 'return the amount of visible enterprise products' do 165 should 'return the amount of visible enterprise products' do
  166 + return unless defined? ProductsPlugin
  167 +
163 b = StatisticsBlock.new 168 b = StatisticsBlock.new
164 169
165 e = fast_create(Enterprise) 170 e = fast_create(Enterprise)