Commit 79d52c33dad28fefb85e9fd7c26aceca81d212fa
Committed by
Alessandro Palmeira
1 parent
60587181
Exists in
master
and in
29 other branches
[Mezuro] Fixed requires for functional tests.
Showing
4 changed files
with
17 additions
and
18 deletions
Show diff stats
plugins/mezuro/test/functional/mezuro_plugin_myprofile_controller_test.rb
1 | require 'test_helper' | 1 | require 'test_helper' |
2 | 2 | ||
3 | -require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/error_fixtures" | ||
4 | require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/base_tool_fixtures" | 3 | require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/base_tool_fixtures" |
5 | -require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/native_metric_fixtures" | 4 | +require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/metric_fixtures" |
6 | require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/metric_configuration_fixtures" | 5 | require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/metric_configuration_fixtures" |
7 | require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/configuration_fixtures" | 6 | require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/configuration_fixtures" |
8 | 7 | ||
@@ -16,7 +15,7 @@ class MezuroPluginMyprofileControllerTest < ActionController::TestCase | @@ -16,7 +15,7 @@ class MezuroPluginMyprofileControllerTest < ActionController::TestCase | ||
16 | 15 | ||
17 | @base_tool = BaseToolFixtures.base_tool | 16 | @base_tool = BaseToolFixtures.base_tool |
18 | @base_tool_hash = BaseToolFixtures.base_tool_hash | 17 | @base_tool_hash = BaseToolFixtures.base_tool_hash |
19 | - @metric = NativeMetricFixtures.amloc | 18 | + @metric = MetricFixtures.amloc |
20 | @metric_configuration = MetricConfigurationFixtures.amloc_metric_configuration | 19 | @metric_configuration = MetricConfigurationFixtures.amloc_metric_configuration |
21 | @metric_configuration_hash = MetricConfigurationFixtures.amloc_metric_configuration_hash | 20 | @metric_configuration_hash = MetricConfigurationFixtures.amloc_metric_configuration_hash |
22 | @compound_metric_configuration = MetricConfigurationFixtures.sc_metric_configuration | 21 | @compound_metric_configuration = MetricConfigurationFixtures.sc_metric_configuration |
plugins/mezuro/test/functional/myprofile/mezuro_plugin_metric_configuration_controller_test.rb
1 | require 'test_helper' | 1 | require 'test_helper' |
2 | 2 | ||
3 | require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/base_tool_fixtures" | 3 | require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/base_tool_fixtures" |
4 | -require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/native_metric_fixtures" | 4 | +require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/metric_fixtures" |
5 | require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/metric_configuration_fixtures" | 5 | require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/metric_configuration_fixtures" |
6 | require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/configuration_fixtures" | 6 | require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/configuration_fixtures" |
7 | 7 | ||
@@ -15,7 +15,7 @@ class MezuroPluginMetricConfigurationControllerTest < ActionController::TestCase | @@ -15,7 +15,7 @@ class MezuroPluginMetricConfigurationControllerTest < ActionController::TestCase | ||
15 | 15 | ||
16 | @base_tool = BaseToolFixtures.base_tool | 16 | @base_tool = BaseToolFixtures.base_tool |
17 | @base_tool_hash = BaseToolFixtures.base_tool_hash | 17 | @base_tool_hash = BaseToolFixtures.base_tool_hash |
18 | - @metric = NativeMetricFixtures.amloc | 18 | + @metric = MetricFixtures.amloc |
19 | @metric_configuration = MetricConfigurationFixtures.amloc_metric_configuration | 19 | @metric_configuration = MetricConfigurationFixtures.amloc_metric_configuration |
20 | @metric_configuration_hash = MetricConfigurationFixtures.amloc_metric_configuration_hash | 20 | @metric_configuration_hash = MetricConfigurationFixtures.amloc_metric_configuration_hash |
21 | @compound_metric_configuration = MetricConfigurationFixtures.sc_metric_configuration | 21 | @compound_metric_configuration = MetricConfigurationFixtures.sc_metric_configuration |
plugins/mezuro/test/functional/myprofile/mezuro_plugin_range_controller_test.rb
1 | require 'test_helper' | 1 | require 'test_helper' |
2 | 2 | ||
3 | -require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/native_metric_fixtures" | 3 | +require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/metric_fixtures" |
4 | require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/metric_configuration_fixtures" | 4 | require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/metric_configuration_fixtures" |
5 | require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/configuration_fixtures" | 5 | require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/configuration_fixtures" |
6 | require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/range_fixtures" | 6 | require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/range_fixtures" |
@@ -13,7 +13,7 @@ class MezuroPluginRangeControllerTest < ActionController::TestCase | @@ -13,7 +13,7 @@ class MezuroPluginRangeControllerTest < ActionController::TestCase | ||
13 | @response = ActionController::TestResponse.new | 13 | @response = ActionController::TestResponse.new |
14 | @profile = fast_create(Community) | 14 | @profile = fast_create(Community) |
15 | 15 | ||
16 | - @metric = NativeMetricFixtures.amloc | 16 | + @metric = MetricFixtures.amloc |
17 | @metric_configuration = MetricConfigurationFixtures.amloc_metric_configuration | 17 | @metric_configuration = MetricConfigurationFixtures.amloc_metric_configuration |
18 | @metric_configuration_hash = MetricConfigurationFixtures.amloc_metric_configuration_hash | 18 | @metric_configuration_hash = MetricConfigurationFixtures.amloc_metric_configuration_hash |
19 | @configuration = ConfigurationFixtures.configuration | 19 | @configuration = ConfigurationFixtures.configuration |
plugins/mezuro/test/functional/profile/mezuro_plugin_project_controller_test.rb
1 | require 'test_helper' | 1 | require 'test_helper' |
2 | 2 | ||
3 | -require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/project_result_fixtures" | ||
4 | -require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/error_fixtures" | 3 | +require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/processing_fixtures" |
4 | +require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/throwable_fixtures" | ||
5 | require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/repository_fixtures" | 5 | require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/repository_fixtures" |
6 | 6 | ||
7 | class MezuroPluginProjectControllerTest < ActionController::TestCase | 7 | class MezuroPluginProjectControllerTest < ActionController::TestCase |
@@ -11,7 +11,7 @@ class MezuroPluginProjectControllerTest < ActionController::TestCase | @@ -11,7 +11,7 @@ class MezuroPluginProjectControllerTest < ActionController::TestCase | ||
11 | @response = ActionController::TestResponse.new | 11 | @response = ActionController::TestResponse.new |
12 | @profile = fast_create(Community) | 12 | @profile = fast_create(Community) |
13 | 13 | ||
14 | - @project_result = ProjectResultFixtures.project_result | 14 | + @project_result = ProcessingFixtures.project_result |
15 | @repository_url = RepositoryFixtures.repository.address | 15 | @repository_url = RepositoryFixtures.repository.address |
16 | @project = @project_result.project | 16 | @project = @project_result.project |
17 | @date = "2012-04-13T20:39:41+04:00" | 17 | @date = "2012-04-13T20:39:41+04:00" |
@@ -30,7 +30,7 @@ class MezuroPluginProjectControllerTest < ActionController::TestCase | @@ -30,7 +30,7 @@ class MezuroPluginProjectControllerTest < ActionController::TestCase | ||
30 | end | 30 | end |
31 | 31 | ||
32 | should 'test project state with kalibro_error' do | 32 | should 'test project state with kalibro_error' do |
33 | - Kalibro::Project.expects(:request).with("Project", :get_project, :project_name => @project.name).returns({:project => @project.to_hash.merge({:error => ErrorFixtures.error_hash})}) | 33 | + Kalibro::Project.expects(:request).with("Project", :get_project, :project_name => @project.name).returns({:project => @project.to_hash.merge({:error => ThrowableFixtures.throwable_hash})}) |
34 | get :project_state, :profile => @profile.identifier, :id => @content.id | 34 | get :project_state, :profile => @profile.identifier, :id => @content.id |
35 | assert_response 200 | 35 | assert_response 200 |
36 | assert_equal "ERROR", @response.body | 36 | assert_equal "ERROR", @response.body |
@@ -38,7 +38,7 @@ class MezuroPluginProjectControllerTest < ActionController::TestCase | @@ -38,7 +38,7 @@ class MezuroPluginProjectControllerTest < ActionController::TestCase | ||
38 | end | 38 | end |
39 | 39 | ||
40 | should 'test project error' do | 40 | should 'test project error' do |
41 | - Kalibro::Project.expects(:request).with("Project", :get_project, :project_name => @project.name).returns({:project => @project.to_hash.merge({:error => ErrorFixtures.error_hash})}) | 41 | + Kalibro::Project.expects(:request).with("Project", :get_project, :project_name => @project.name).returns({:project => @project.to_hash.merge({:error => ThrowableFixtures.throwable_hash})}) |
42 | get :project_error, :profile => @profile.identifier, :id => @content.id | 42 | get :project_error, :profile => @profile.identifier, :id => @content.id |
43 | assert_response 200 | 43 | assert_response 200 |
44 | assert_select('h3', 'ERROR') | 44 | assert_select('h3', 'ERROR') |
@@ -47,7 +47,7 @@ class MezuroPluginProjectControllerTest < ActionController::TestCase | @@ -47,7 +47,7 @@ class MezuroPluginProjectControllerTest < ActionController::TestCase | ||
47 | end | 47 | end |
48 | 48 | ||
49 | should 'test project result without date' do | 49 | should 'test project result without date' do |
50 | - Kalibro::ProjectResult.expects(:request).with("ProjectResult", :get_last_result_of, {:project_name => @project.name}).returns({:project_result => @project_result.to_hash}) | 50 | + Kalibro::Processing.expects(:request).with("Processing", :get_last_result_of, {:project_name => @project.name}).returns({:project_result => @project_result.to_hash}) |
51 | get :project_result, :profile => @profile.identifier, :id => @content.id, :date => nil | 51 | get :project_result, :profile => @profile.identifier, :id => @content.id, :date => nil |
52 | assert_equal @content, assigns(:content) | 52 | assert_equal @content, assigns(:content) |
53 | assert_equal @project_result.project.name, assigns(:project_result).project.name | 53 | assert_equal @project_result.project.name, assigns(:project_result).project.name |
@@ -57,8 +57,8 @@ class MezuroPluginProjectControllerTest < ActionController::TestCase | @@ -57,8 +57,8 @@ class MezuroPluginProjectControllerTest < ActionController::TestCase | ||
57 | 57 | ||
58 | should 'test project results from a specific date' do | 58 | should 'test project results from a specific date' do |
59 | request_body = {:project_name => @project.name, :date => @date} | 59 | request_body = {:project_name => @project.name, :date => @date} |
60 | - Kalibro::ProjectResult.expects(:request).with("ProjectResult", :has_results_before, request_body).returns({:has_results => true}) | ||
61 | - Kalibro::ProjectResult.expects(:request).with("ProjectResult", :get_last_result_before, request_body).returns({:project_result => @project_result.to_hash}) | 60 | + Kalibro::Processing.expects(:request).with("Processing", :has_results_before, request_body).returns({:has_results => true}) |
61 | + Kalibro::Processing.expects(:request).with("Processing", :get_last_result_before, request_body).returns({:project_result => @project_result.to_hash}) | ||
62 | get :project_result, :profile => @profile.identifier, :id => @content.id, :date => @date | 62 | get :project_result, :profile => @profile.identifier, :id => @content.id, :date => @date |
63 | assert_equal @content, assigns(:content) | 63 | assert_equal @content, assigns(:content) |
64 | assert_equal @project_result.project.name, assigns(:project_result).project.name | 64 | assert_equal @project_result.project.name, assigns(:project_result).project.name |
@@ -67,7 +67,7 @@ class MezuroPluginProjectControllerTest < ActionController::TestCase | @@ -67,7 +67,7 @@ class MezuroPluginProjectControllerTest < ActionController::TestCase | ||
67 | end | 67 | end |
68 | 68 | ||
69 | should 'test project tree without date' do | 69 | should 'test project tree without date' do |
70 | - Kalibro::ProjectResult.expects(:request).with("ProjectResult", :get_last_result_of, {:project_name => @project.name}).returns({:project_result => @project_result.to_hash}) | 70 | + Kalibro::Processing.expects(:request).with("Processing", :get_last_result_of, {:project_name => @project.name}).returns({:project_result => @project_result.to_hash}) |
71 | Kalibro::Project.expects(:request).with("Project", :get_project, :project_name => @project.name).returns({:project => @project.to_hash}) | 71 | Kalibro::Project.expects(:request).with("Project", :get_project, :project_name => @project.name).returns({:project => @project.to_hash}) |
72 | get :project_tree, :profile => @profile.identifier, :id => @content.id, :module_name => @project.name, :date => nil | 72 | get :project_tree, :profile => @profile.identifier, :id => @content.id, :module_name => @project.name, :date => nil |
73 | assert_equal @content, assigns(:content) | 73 | assert_equal @content, assigns(:content) |
@@ -80,8 +80,8 @@ class MezuroPluginProjectControllerTest < ActionController::TestCase | @@ -80,8 +80,8 @@ class MezuroPluginProjectControllerTest < ActionController::TestCase | ||
80 | should 'test project tree with a specific date' do | 80 | should 'test project tree with a specific date' do |
81 | request_body = {:project_name => @project.name, :date => @project_result.date} | 81 | request_body = {:project_name => @project.name, :date => @project_result.date} |
82 | Kalibro::Project.expects(:request).with("Project", :get_project, :project_name => @project.name).returns({:project => @project.to_hash}) | 82 | Kalibro::Project.expects(:request).with("Project", :get_project, :project_name => @project.name).returns({:project => @project.to_hash}) |
83 | - Kalibro::ProjectResult.expects(:request).with("ProjectResult", :has_results_before, request_body).returns({:has_results => true}) | ||
84 | - Kalibro::ProjectResult.expects(:request).with("ProjectResult", :get_last_result_before, request_body).returns({:project_result => @project_result.to_hash}) | 83 | + Kalibro::Processing.expects(:request).with("Processing", :has_results_before, request_body).returns({:has_results => true}) |
84 | + Kalibro::Processing.expects(:request).with("Processing", :get_last_result_before, request_body).returns({:project_result => @project_result.to_hash}) | ||
85 | get :project_tree, :profile => @profile.identifier, :id => @content.id, :module_name => @project.name, :date => @project_result.date | 85 | get :project_tree, :profile => @profile.identifier, :id => @content.id, :module_name => @project.name, :date => @project_result.date |
86 | assert_equal @content, assigns(:content) | 86 | assert_equal @content, assigns(:content) |
87 | assert_equal @project.name, assigns(:project_name) | 87 | assert_equal @project.name, assigns(:project_name) |