From c4d258c283d74e5a799af00b0d425c2c5dd9b7d8 Mon Sep 17 00:00:00 2001 From: Paulo Meirelles Date: Tue, 14 Feb 2012 01:17:41 +0300 Subject: [PATCH] [Mezuro] Add plugin view path into controller to functional tests find partials --- plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb | 1 + plugins/mezuro/test/functional/mezuro_plugin_profile_controller_test.rb | 23 +++++++++++------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb b/plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb index aa9893b..61cb96c 100644 --- a/plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb +++ b/plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb @@ -1,4 +1,5 @@ class MezuroPluginProfileController < ProfileController + append_view_path File.join(File.dirname(__FILE__) + '/../views') def metrics project_content = profile.articles.find(params[:id]) diff --git a/plugins/mezuro/test/functional/mezuro_plugin_profile_controller_test.rb b/plugins/mezuro/test/functional/mezuro_plugin_profile_controller_test.rb index c567a7c..205cfb5 100644 --- a/plugins/mezuro/test/functional/mezuro_plugin_profile_controller_test.rb +++ b/plugins/mezuro/test/functional/mezuro_plugin_profile_controller_test.rb @@ -17,18 +17,17 @@ class MezuroPluginProfileControllerTest < ActionController::TestCase @project = @project_result.project end -# def test_metrics_for_unknown_project -# get :metrics, :profile => @profile_id -# assert_response 404 -# end -# -# def test_metric_unknown_module -# get :metrics, :profile => @profile_id, :id => @project_content.id, :module_name => 'veryunlikelyname' -# assert_response 404 -# end - - - def test_metrics_for_known_module + def test_metrics_for_unknown_project + get :metrics, :profile => @profile_id + assert_response 404 + end + + def test_metric_unknown_module + get :metrics, :profile => @profile_id, :id => @project_content.id, :module_name => 'veryunlikelyname' + assert_response 404 + end + + should 'get metrics from a known module' do project_content = create_project_content(@profile) project_name = project_content.name module_name = project_name -- libgit2 0.21.2