Commit ecf44598cfe4e9b2e7c7f5a9b7bb70cfb6c57301

Authored by João M. M. da Silva + Rafael Manzo
Committed by Paulo Meireles
1 parent e8686439

[Mezuro] rebase made from mezuro but one test is failing

plugins/mezuro/test/functional/mezuro_plugin_profile_controller_test.rb
@@ -110,11 +110,12 @@ class MezuroPluginProfileControllerTest < ActionController::TestCase @@ -110,11 +110,12 @@ class MezuroPluginProfileControllerTest < ActionController::TestCase
110 110
111 should 'get grade history' do 111 should 'get grade history' do
112 create_project_content 112 create_project_content
113 - client = mock  
114 - Kalibro::Client::ModuleResultClient.expects(:new).returns(client)  
115 - client.expects(:result_history).returns([@module_result]) 113 + module_result_client = mock
  114 + Kalibro::Client::ModuleResultClient.expects(:new).returns(module_result_client)
  115 + module_result_client.expects(:result_history).with(@name, @name).returns([@module_result])
  116 + Kalibro::Client::ProjectClient.expects(:project).with(@name).returns(@project)
116 get :module_grade_history, :profile => @profile.identifier, :id => @content.id, :module_name => @name 117 get :module_grade_history, :profile => @profile.identifier, :id => @content.id, :module_name => @name
117 - assert_equal assings(:modules_results)[0].grade, 10.0 118 + assert_equal assigns(:modules_results), [@module_result]
118 assert_response 200 119 assert_response 200
119 end 120 end
120 121
@@ -140,4 +141,9 @@ class MezuroPluginProfileControllerTest < ActionController::TestCase @@ -140,4 +141,9 @@ class MezuroPluginProfileControllerTest < ActionController::TestCase
140 module_result_client.expects(:module_result).with(@name, @name, @project_result.date).returns(@module_result) 141 module_result_client.expects(:module_result).with(@name, @name, @project_result.date).returns(@module_result)
141 end 142 end
142 143
  144 + def mock_module_result_history
  145 + module_result_client = mock
  146 + Kalibro::Client::ModuleResultClient.expects(:new).returns(module_result_client)
  147 + module_result_client.expects(:result_history).with(@name, @name).returns([@module_result])
  148 + end
143 end 149 end