From 5b5b05f5c809d77ffaafa048d661f0d5b532b6e7 Mon Sep 17 00:00:00 2001 From: Leandro Nunes dos Santos Date: Thu, 19 May 2016 15:29:33 -0300 Subject: [PATCH] fix unit tests --- lib/proposals_discussion_plugin.rb | 4 ++-- test/test_helper.rb | 2 +- test/unit/api_test.rb | 1 + test/unit/proposal_helper_test.rb | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/proposals_discussion_plugin.rb b/lib/proposals_discussion_plugin.rb index 6c38b33..0c1f677 100644 --- a/lib/proposals_discussion_plugin.rb +++ b/lib/proposals_discussion_plugin.rb @@ -37,8 +37,8 @@ class ProposalsDiscussionPlugin < Noosfero::Plugin def content_remove_new(page) page.kind_of?(ProposalsDiscussionPlugin::Discussion) || - page.kind_of?(ProposalsDiscussionPlugin::Topic) || - page.kind_of?(ProposalsDiscussionPlugin::Proposal) + page.kind_of?(ProposalsDiscussionPlugin::Topic) || + page.kind_of?(ProposalsDiscussionPlugin::Proposal) end def content_remove_upload(page) diff --git a/test/test_helper.rb b/test/test_helper.rb index 70322cf..1d8d247 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1 +1 @@ -require_relative '../../../test/test_helper' +require 'test_helper' diff --git a/test/unit/api_test.rb b/test/unit/api_test.rb index 5d61c3e..95dac8b 100644 --- a/test/unit/api_test.rb +++ b/test/unit/api_test.rb @@ -4,6 +4,7 @@ require_relative '../../../../test/api/test_helper' class APITest < ActiveSupport::TestCase def setup + create_and_activate_user login_api environment = Environment.default environment.enable_plugin(ProposalsDiscussionPlugin) diff --git a/test/unit/proposal_helper_test.rb b/test/unit/proposal_helper_test.rb index ea74c6d..c52c459 100644 --- a/test/unit/proposal_helper_test.rb +++ b/test/unit/proposal_helper_test.rb @@ -31,7 +31,7 @@ class ProposalHelperTest < ActionView::TestCase end should 'display proposal tags' do - proposal.expects(:tags).returns([ActsAsTaggableOn::Tag.new]) + proposal.expects(:tags).returns([ActsAsTaggableOn::Tag.new(:name => 'a tag')]) proposal.expects(:profile).returns(fast_create(Profile)) assert proposal_tags(proposal).present? end -- libgit2 0.21.2