Commit 5b5b05f5c809d77ffaafa048d661f0d5b532b6e7

Authored by Leandro Santos
1 parent 2bd7ffc8

fix unit tests

lib/proposals_discussion_plugin.rb
@@ -37,8 +37,8 @@ class ProposalsDiscussionPlugin < Noosfero::Plugin @@ -37,8 +37,8 @@ class ProposalsDiscussionPlugin < Noosfero::Plugin
37 37
38 def content_remove_new(page) 38 def content_remove_new(page)
39 page.kind_of?(ProposalsDiscussionPlugin::Discussion) || 39 page.kind_of?(ProposalsDiscussionPlugin::Discussion) ||
40 - page.kind_of?(ProposalsDiscussionPlugin::Topic) ||  
41 - page.kind_of?(ProposalsDiscussionPlugin::Proposal) 40 + page.kind_of?(ProposalsDiscussionPlugin::Topic) ||
  41 + page.kind_of?(ProposalsDiscussionPlugin::Proposal)
42 end 42 end
43 43
44 def content_remove_upload(page) 44 def content_remove_upload(page)
test/test_helper.rb
1 -require_relative '../../../test/test_helper' 1 +require 'test_helper'
test/unit/api_test.rb
@@ -4,6 +4,7 @@ require_relative '../../../../test/api/test_helper' @@ -4,6 +4,7 @@ require_relative '../../../../test/api/test_helper'
4 class APITest < ActiveSupport::TestCase 4 class APITest < ActiveSupport::TestCase
5 5
6 def setup 6 def setup
  7 + create_and_activate_user
7 login_api 8 login_api
8 environment = Environment.default 9 environment = Environment.default
9 environment.enable_plugin(ProposalsDiscussionPlugin) 10 environment.enable_plugin(ProposalsDiscussionPlugin)
test/unit/proposal_helper_test.rb
@@ -31,7 +31,7 @@ class ProposalHelperTest &lt; ActionView::TestCase @@ -31,7 +31,7 @@ class ProposalHelperTest &lt; ActionView::TestCase
31 end 31 end
32 32
33 should 'display proposal tags' do 33 should 'display proposal tags' do
34 - proposal.expects(:tags).returns([ActsAsTaggableOn::Tag.new]) 34 + proposal.expects(:tags).returns([ActsAsTaggableOn::Tag.new(:name => 'a tag')])
35 proposal.expects(:profile).returns(fast_create(Profile)) 35 proposal.expects(:profile).returns(fast_create(Profile))
36 assert proposal_tags(proposal).present? 36 assert proposal_tags(proposal).present?
37 end 37 end