diff --git a/plugins/people_block/test/functional/people_block_plugin_profile_controller_test.rb b/plugins/people_block/test/functional/people_block_plugin_profile_controller_test.rb index f0901e4..4014672 100644 --- a/plugins/people_block/test/functional/people_block_plugin_profile_controller_test.rb +++ b/plugins/people_block/test/functional/people_block_plugin_profile_controller_test.rb @@ -1,5 +1,5 @@ -require File.dirname(__FILE__) + '/../test_helper' -require File.dirname(__FILE__) + '/../../controllers/people_block_plugin_profile_controller' +require_relative '../test_helper' +require_relative '../../controllers/people_block_plugin_profile_controller' # Re-raise errors caught by the controller. diff --git a/plugins/people_block/test/unit/friends_block_test.rb b/plugins/people_block/test/unit/friends_block_test.rb index fc5fd44..38cc5de 100644 --- a/plugins/people_block/test/unit/friends_block_test.rb +++ b/plugins/people_block/test/unit/friends_block_test.rb @@ -1,4 +1,4 @@ -require File.dirname(__FILE__) + '/../test_helper' +require_relative '../test_helper' class FriendsBlockTest < ActionView::TestCase diff --git a/test/test_helper.rb b/test/test_helper.rb index 7493ec8..b64836b 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -154,6 +154,21 @@ class ActiveSupport::TestCase self.class.action_view.render(*args) end + def url_for args = {} + args + end + + # url_for inside views (partials) + # from http://stackoverflow.com/a/13704257/670229 + ActionView::TestCase::TestController.instance_eval do + helper Noosfero::Application.routes.url_helpers + end + ActionView::TestCase::TestController.class_eval do + def _routes + Noosfero::Application.routes + end + end + private def uses_host(name) @@ -234,10 +249,6 @@ module NoosferoTestHelper def will_paginate(arg1, arg2) end - def url_for(args = {}) - args - end - def javascript_tag(any) '' end -- libgit2 0.21.2