diff --git a/plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb b/plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb new file mode 100644 index 0000000..216624f --- /dev/null +++ b/plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb @@ -0,0 +1,9 @@ +class MezuroPluginProfileController < ProfileController + + def metrics + project = profile.articles.find(params[:id]) + module_name = params[:module_name] + render :partial => 'content_viewer/module_result', :locals => { :module_result => project.module_result(module_name) } + end + +end diff --git a/plugins/mezuro/test/functional/mezuro_plugin_profile_controller_test.rb b/plugins/mezuro/test/functional/mezuro_plugin_profile_controller_test.rb new file mode 100644 index 0000000..c7bfc41 --- /dev/null +++ b/plugins/mezuro/test/functional/mezuro_plugin_profile_controller_test.rb @@ -0,0 +1,33 @@ +require 'test_helper' + +class MezuroPluginProfileControllerTest < ActiveSupport::TestCase + + def setup + @controller = MezuroPluginProfileController.new + @request = ActionController::TestRequest.new + @response = ActionController::TestResponse.new + @profile = fast_create(Community) + @profile_id = @profile.identifier + end + + def test_metrics_for_unknown_module + get :metrics, :profile => @profile_id, :id => 0 + assert_response 404 + end + + # TODO + # def test_metrics_for_known_module + # @project = create_project(profile) + # @controller.stubs(:find_project).returns(@project) + # get :metrics, :profile => @profile_id, :id => project.id, :module_name => _ + # assert_ + # end + + protected + + # returns a new ProjectContent for the given profile + def create_project(profile) + + end + +end diff --git a/plugins/mezuro/test/mezuro_test.rb b/plugins/mezuro/test/mezuro_test.rb index 2593437..4c59b8b 100644 --- a/plugins/mezuro/test/mezuro_test.rb +++ b/plugins/mezuro/test/mezuro_test.rb @@ -1,5 +1,4 @@ require "test_helper" -require File.dirname(__FILE__) + '/../../../test/test_helper' require File.dirname(__FILE__) + '/../controllers/mezuro_plugin_myprofile_controller' class MezuroTest < ActiveSupport::TestCase -- libgit2 0.21.2