From 5768e86220ef26761d2be1a38a4739968a7f7e73 Mon Sep 17 00:00:00 2001 From: Rafael Reggiani Manzo Date: Wed, 30 May 2012 16:50:29 -0300 Subject: [PATCH] [Mezuro] Fixed tests --- plugins/mezuro/test/functional/mezuro_plugin_myprofile_controller_test.rb | 19 +++++++------------ plugins/mezuro/test/functional/mezuro_plugin_profile_controller_test.rb | 1 - 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/plugins/mezuro/test/functional/mezuro_plugin_myprofile_controller_test.rb b/plugins/mezuro/test/functional/mezuro_plugin_myprofile_controller_test.rb index 2f062a6..f3c5a2c 100644 --- a/plugins/mezuro/test/functional/mezuro_plugin_myprofile_controller_test.rb +++ b/plugins/mezuro/test/functional/mezuro_plugin_myprofile_controller_test.rb @@ -84,21 +84,16 @@ class MezuroPluginMyprofileControllerTest < ActionController::TestCase should 'test metric edition' do Kalibro::Client::MetricConfigurationClient.expects(:new).returns(@metric_configuration_client) - @metric_configuration_client.expects(:save) - get :create_metric_configuration, :profile => @profile.identifier, :configuration_name => "test name", :description => @metric.description, - :scope => @metric.scope, :language => @metric.language, :metric => { :name => @metric.name, :origin => @metric.origin}, - :metric_configuration => { :code => @metric_configuration.code, :weight => @metric_configuration.code, :aggregation => @metric_configuration.aggregation_form } - assert_equal assigns(:configuration_name), "test name" - assert_response 302 + @metric_configuration_client.expects(:metric_configuration).with("test name","test metric name").returns(@metric_configuration) + get :edit_metric_configuration, :profile => @profile.identifier, :configuration_name => "test name", :metric_name => "test metric name" + assert_response 200 end - should 'test compound metric edition' do #FIXME this test should test the "edit_compound_metric_configuration" action on the controller + should 'test compound metric edition' do Kalibro::Client::MetricConfigurationClient.expects(:new).returns(@metric_configuration_client) - @metric_configuration_client.expects(:save) - get :edit_compound_metric_configuration, :profile => @profile.identifier, :configuration_name => "test name", :metric_name => "test metric name", :description => @metric.description, - :scope => @metric.scope, :language => @metric.language, :metric => { :name => @metric.name}, - :metric_configuration => { :script => @compound_metric_configuration.metric.script, :code => @compound_metric_configuration.code, :weight => @compound_metric_configuration.code, :aggregation => @compound_metric_configuration.aggregation_form} - assert_response 302 + @metric_configuration_client.expects(:metric_configuration).with("test name","test metric name").returns(@compound_metric_configuration) + get :edit_compound_metric_configuration, :profile => @profile.identifier, :configuration_name => "test name", :metric_name => "test metric name" + assert_response 200 end should 'assign configuration name and metric name to new range' do 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 806a550..b9b782a 100644 --- a/plugins/mezuro/test/functional/mezuro_plugin_profile_controller_test.rb +++ b/plugins/mezuro/test/functional/mezuro_plugin_profile_controller_test.rb @@ -123,7 +123,6 @@ class MezuroPluginProfileControllerTest < ActionController::TestCase def create_project_content @content = MezuroPlugin::ProjectContent.new(:profile => @profile, :name => @name) @content.expects(:send_project_to_service).returns(nil) - Kalibro::Client::ProjectClient.expects(:project).raises("there's no project named macaco") @content.save end -- libgit2 0.21.2