Commit c4d258c283d74e5a799af00b0d425c2c5dd9b7d8

Authored by Paulo Meireles
1 parent 4c598d73

[Mezuro] Add plugin view path into controller to functional tests find partials

plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb
1 1 class MezuroPluginProfileController < ProfileController
  2 + append_view_path File.join(File.dirname(__FILE__) + '/../views')
2 3  
3 4 def metrics
4 5 project_content = profile.articles.find(params[:id])
... ...
plugins/mezuro/test/functional/mezuro_plugin_profile_controller_test.rb
... ... @@ -17,18 +17,17 @@ class MezuroPluginProfileControllerTest &lt; ActionController::TestCase
17 17 @project = @project_result.project
18 18 end
19 19  
20   -# def test_metrics_for_unknown_project
21   -# get :metrics, :profile => @profile_id
22   -# assert_response 404
23   -# end
24   -#
25   -# def test_metric_unknown_module
26   -# get :metrics, :profile => @profile_id, :id => @project_content.id, :module_name => 'veryunlikelyname'
27   -# assert_response 404
28   -# end
29   -
30   -
31   - def test_metrics_for_known_module
  20 + def test_metrics_for_unknown_project
  21 + get :metrics, :profile => @profile_id
  22 + assert_response 404
  23 + end
  24 +
  25 + def test_metric_unknown_module
  26 + get :metrics, :profile => @profile_id, :id => @project_content.id, :module_name => 'veryunlikelyname'
  27 + assert_response 404
  28 + end
  29 +
  30 + should 'get metrics from a known module' do
32 31 project_content = create_project_content(@profile)
33 32 project_name = project_content.name
34 33 module_name = project_name
... ...