Commit e9d19fcfb276a892208ccab53f317da5d4fedee3
1 parent
5bed328d
Exists in
staging
and in
29 other branches
statistics: fix optional dependency on products plugin
Showing
1 changed file
with
5 additions
and
0 deletions
Show diff stats
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 < ActiveSupport::TestCase | @@ -140,6 +141,8 @@ class StatisticsBlockTest < 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 < ActiveSupport::TestCase | @@ -160,6 +163,8 @@ class StatisticsBlockTest < 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) |