From e421a80381b6ac0434157eef825637e75f50b8fe Mon Sep 17 00:00:00 2001 From: Diego Araújo + Pedro Leal Date: Thu, 5 Apr 2012 16:48:37 -0300 Subject: [PATCH] [Mezuro] Created new method result_history and updated tests --- plugins/mezuro/lib/mezuro_plugin/project_content.rb | 4 ++++ plugins/mezuro/test/unit/mezuro_plugin/project_content_test.rb | 8 ++++++++ 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/plugins/mezuro/lib/mezuro_plugin/project_content.rb b/plugins/mezuro/lib/mezuro_plugin/project_content.rb index 604b5fb..80d8c53 100644 --- a/plugins/mezuro/lib/mezuro_plugin/project_content.rb +++ b/plugins/mezuro/lib/mezuro_plugin/project_content.rb @@ -30,6 +30,10 @@ class MezuroPlugin::ProjectContent < Article @module_client ||= module_result_client.module_result(project.name, module_name, project_result.date) end + def result_history(module_name) + @result_history ||= module_result_client.result_history(project.name, module_name) + end + def module_result_client @module_result_client ||= Kalibro::Client::ModuleResultClient.new end diff --git a/plugins/mezuro/test/unit/mezuro_plugin/project_content_test.rb b/plugins/mezuro/test/unit/mezuro_plugin/project_content_test.rb index 5cde95c..934fdf6 100644 --- a/plugins/mezuro/test/unit/mezuro_plugin/project_content_test.rb +++ b/plugins/mezuro/test/unit/mezuro_plugin/project_content_test.rb @@ -68,6 +68,14 @@ class ProjectContentTest < ActiveSupport::TestCase assert_equal module_result, @content.module_result(nil) end + should 'get result history' do + module_name = 'Qt-Calculator' + module_result_client = mock + @content.expects(:module_result_client).returns(module_result_client) + module_result_client.expects(:result_history).with(@project.name, module_name) + @content.result_history(module_name) + end + should 'send project to service after saving' do @content.expects :send_project_to_service @content.run_callbacks :after_save -- libgit2 0.21.2