Commit c4d258c283d74e5a799af00b0d425c2c5dd9b7d8
1 parent
4c598d73
Exists in
master
and in
28 other branches
[Mezuro] Add plugin view path into controller to functional tests find partials
Showing
2 changed files
with
12 additions
and
12 deletions
Show diff stats
plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb
| 1 | class MezuroPluginProfileController < ProfileController | 1 | class MezuroPluginProfileController < ProfileController |
| 2 | + append_view_path File.join(File.dirname(__FILE__) + '/../views') | ||
| 2 | 3 | ||
| 3 | def metrics | 4 | def metrics |
| 4 | project_content = profile.articles.find(params[:id]) | 5 | project_content = profile.articles.find(params[:id]) |
plugins/mezuro/test/functional/mezuro_plugin_profile_controller_test.rb
| @@ -17,18 +17,17 @@ class MezuroPluginProfileControllerTest < ActionController::TestCase | @@ -17,18 +17,17 @@ class MezuroPluginProfileControllerTest < ActionController::TestCase | ||
| 17 | @project = @project_result.project | 17 | @project = @project_result.project |
| 18 | end | 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 | project_content = create_project_content(@profile) | 31 | project_content = create_project_content(@profile) |
| 33 | project_name = project_content.name | 32 | project_name = project_content.name |
| 34 | module_name = project_name | 33 | module_name = project_name |