Commit bf73d4eabdc000b58b7d2fe9ba00801abb2a538a
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
Merge branch 'hotfixes' into stable
Showing
2 changed files
with
2 additions
and
2 deletions
Show diff stats
plugins/community_track/lib/community_track_plugin.rb
... | ... | @@ -13,8 +13,7 @@ class CommunityTrackPlugin < Noosfero::Plugin |
13 | 13 | end |
14 | 14 | |
15 | 15 | def content_types |
16 | - return [] if !context.kind_of?(CmsController) | |
17 | - if context.respond_to?(:params) && context.params | |
16 | + if context.kind_of?(CmsController) && context.respond_to?(:params) && context.params | |
18 | 17 | types = [] |
19 | 18 | parent_id = context.params[:parent_id] |
20 | 19 | types << CommunityTrackPlugin::Track if context.profile.community? && !parent_id | ... | ... |
plugins/community_track/test/unit/community_track_plugin_test.rb
... | ... | @@ -7,6 +7,7 @@ class CommunityTrackPluginTest < ActiveSupport::TestCase |
7 | 7 | @profile = fast_create(Community) |
8 | 8 | @params = {} |
9 | 9 | @context = mock |
10 | + @context.stubs(:kind_of?).returns(CmsController) | |
10 | 11 | @context.stubs(:profile).returns(@profile) |
11 | 12 | @context.stubs(:params).returns(@params) |
12 | 13 | @plugin.stubs(:context).returns(@context) | ... | ... |