Commit 5768e86220ef26761d2be1a38a4739968a7f7e73
1 parent
bef57db1
Exists in
master
and in
28 other branches
[Mezuro] Fixed tests
Showing
2 changed files
with
7 additions
and
13 deletions
Show diff stats
plugins/mezuro/test/functional/mezuro_plugin_myprofile_controller_test.rb
... | ... | @@ -84,21 +84,16 @@ class MezuroPluginMyprofileControllerTest < ActionController::TestCase |
84 | 84 | |
85 | 85 | should 'test metric edition' do |
86 | 86 | Kalibro::Client::MetricConfigurationClient.expects(:new).returns(@metric_configuration_client) |
87 | - @metric_configuration_client.expects(:save) | |
88 | - get :create_metric_configuration, :profile => @profile.identifier, :configuration_name => "test name", :description => @metric.description, | |
89 | - :scope => @metric.scope, :language => @metric.language, :metric => { :name => @metric.name, :origin => @metric.origin}, | |
90 | - :metric_configuration => { :code => @metric_configuration.code, :weight => @metric_configuration.code, :aggregation => @metric_configuration.aggregation_form } | |
91 | - assert_equal assigns(:configuration_name), "test name" | |
92 | - assert_response 302 | |
87 | + @metric_configuration_client.expects(:metric_configuration).with("test name","test metric name").returns(@metric_configuration) | |
88 | + get :edit_metric_configuration, :profile => @profile.identifier, :configuration_name => "test name", :metric_name => "test metric name" | |
89 | + assert_response 200 | |
93 | 90 | end |
94 | 91 | |
95 | - should 'test compound metric edition' do #FIXME this test should test the "edit_compound_metric_configuration" action on the controller | |
92 | + should 'test compound metric edition' do | |
96 | 93 | Kalibro::Client::MetricConfigurationClient.expects(:new).returns(@metric_configuration_client) |
97 | - @metric_configuration_client.expects(:save) | |
98 | - get :edit_compound_metric_configuration, :profile => @profile.identifier, :configuration_name => "test name", :metric_name => "test metric name", :description => @metric.description, | |
99 | - :scope => @metric.scope, :language => @metric.language, :metric => { :name => @metric.name}, | |
100 | - :metric_configuration => { :script => @compound_metric_configuration.metric.script, :code => @compound_metric_configuration.code, :weight => @compound_metric_configuration.code, :aggregation => @compound_metric_configuration.aggregation_form} | |
101 | - assert_response 302 | |
94 | + @metric_configuration_client.expects(:metric_configuration).with("test name","test metric name").returns(@compound_metric_configuration) | |
95 | + get :edit_compound_metric_configuration, :profile => @profile.identifier, :configuration_name => "test name", :metric_name => "test metric name" | |
96 | + assert_response 200 | |
102 | 97 | end |
103 | 98 | |
104 | 99 | should 'assign configuration name and metric name to new range' do | ... | ... |
plugins/mezuro/test/functional/mezuro_plugin_profile_controller_test.rb
... | ... | @@ -123,7 +123,6 @@ class MezuroPluginProfileControllerTest < ActionController::TestCase |
123 | 123 | def create_project_content |
124 | 124 | @content = MezuroPlugin::ProjectContent.new(:profile => @profile, :name => @name) |
125 | 125 | @content.expects(:send_project_to_service).returns(nil) |
126 | - Kalibro::Client::ProjectClient.expects(:project).raises("there's no project named macaco") | |
127 | 126 | @content.save |
128 | 127 | end |
129 | 128 | ... | ... |