Commit 8f344c49931ae433261506dd21f2a44e8a06592d
Committed by
Paulo Meireles
1 parent
042a5920
Exists in
master
and in
29 other branches
[Mezuro] In order to test the module_grade_history method from mezuro_plugin_pro…
…file_controller the only thing testable is the partial renderization
Showing
1 changed file
with
2 additions
and
5 deletions
Show diff stats
plugins/mezuro/test/functional/mezuro_plugin_profile_controller_test.rb
| ... | ... | @@ -110,12 +110,9 @@ class MezuroPluginProfileControllerTest < ActionController::TestCase |
| 110 | 110 | |
| 111 | 111 | should 'get grade history' do |
| 112 | 112 | create_project_content |
| 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]) | |
| 113 | + mock_module_result_history | |
| 116 | 114 | Kalibro::Client::ProjectClient.expects(:project).with(@name).returns(@project) |
| 117 | 115 | get :module_grade_history, :profile => @profile.identifier, :id => @content.id, :module_name => @name |
| 118 | - assert_equal [@module_result], assigns(:modules_results) | |
| 119 | 116 | assert_response 200 |
| 120 | 117 | end |
| 121 | 118 | |
| ... | ... | @@ -143,7 +140,7 @@ class MezuroPluginProfileControllerTest < ActionController::TestCase |
| 143 | 140 | |
| 144 | 141 | def mock_module_result_history |
| 145 | 142 | module_result_client = mock |
| 146 | - Kalibro::Client::ModuleResultClient.expects(:new).returns(module_result_client) | |
| 147 | 143 | module_result_client.expects(:result_history).with(@name, @name).returns([@module_result]) |
| 144 | + Kalibro::Client::ModuleResultClient.expects(:new).returns(module_result_client) | |
| 148 | 145 | end |
| 149 | 146 | end | ... | ... |