Commit 79d52c33dad28fefb85e9fd7c26aceca81d212fa

Authored by Diego Camarinha
Committed by Alessandro Palmeira
1 parent 60587181

[Mezuro] Fixed requires for functional tests.

plugins/mezuro/test/functional/mezuro_plugin_myprofile_controller_test.rb
1 1 require 'test_helper'
2 2  
3   -require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/error_fixtures"
4 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 5 require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/metric_configuration_fixtures"
7 6 require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/configuration_fixtures"
8 7  
... ... @@ -16,7 +15,7 @@ class MezuroPluginMyprofileControllerTest < ActionController::TestCase
16 15  
17 16 @base_tool = BaseToolFixtures.base_tool
18 17 @base_tool_hash = BaseToolFixtures.base_tool_hash
19   - @metric = NativeMetricFixtures.amloc
  18 + @metric = MetricFixtures.amloc
20 19 @metric_configuration = MetricConfigurationFixtures.amloc_metric_configuration
21 20 @metric_configuration_hash = MetricConfigurationFixtures.amloc_metric_configuration_hash
22 21 @compound_metric_configuration = MetricConfigurationFixtures.sc_metric_configuration
... ...
plugins/mezuro/test/functional/myprofile/mezuro_plugin_metric_configuration_controller_test.rb
1 1 require 'test_helper'
2 2  
3 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 5 require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/metric_configuration_fixtures"
6 6 require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/configuration_fixtures"
7 7  
... ... @@ -15,7 +15,7 @@ class MezuroPluginMetricConfigurationControllerTest < ActionController::TestCase
15 15  
16 16 @base_tool = BaseToolFixtures.base_tool
17 17 @base_tool_hash = BaseToolFixtures.base_tool_hash
18   - @metric = NativeMetricFixtures.amloc
  18 + @metric = MetricFixtures.amloc
19 19 @metric_configuration = MetricConfigurationFixtures.amloc_metric_configuration
20 20 @metric_configuration_hash = MetricConfigurationFixtures.amloc_metric_configuration_hash
21 21 @compound_metric_configuration = MetricConfigurationFixtures.sc_metric_configuration
... ...
plugins/mezuro/test/functional/myprofile/mezuro_plugin_range_controller_test.rb
1 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 4 require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/metric_configuration_fixtures"
5 5 require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/configuration_fixtures"
6 6 require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/range_fixtures"
... ... @@ -13,7 +13,7 @@ class MezuroPluginRangeControllerTest < ActionController::TestCase
13 13 @response = ActionController::TestResponse.new
14 14 @profile = fast_create(Community)
15 15  
16   - @metric = NativeMetricFixtures.amloc
  16 + @metric = MetricFixtures.amloc
17 17 @metric_configuration = MetricConfigurationFixtures.amloc_metric_configuration
18 18 @metric_configuration_hash = MetricConfigurationFixtures.amloc_metric_configuration_hash
19 19 @configuration = ConfigurationFixtures.configuration
... ...
plugins/mezuro/test/functional/profile/mezuro_plugin_project_controller_test.rb
1 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 5 require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/repository_fixtures"
6 6  
7 7 class MezuroPluginProjectControllerTest < ActionController::TestCase
... ... @@ -11,7 +11,7 @@ class MezuroPluginProjectControllerTest &lt; ActionController::TestCase
11 11 @response = ActionController::TestResponse.new
12 12 @profile = fast_create(Community)
13 13  
14   - @project_result = ProjectResultFixtures.project_result
  14 + @project_result = ProcessingFixtures.project_result
15 15 @repository_url = RepositoryFixtures.repository.address
16 16 @project = @project_result.project
17 17 @date = "2012-04-13T20:39:41+04:00"
... ... @@ -30,7 +30,7 @@ class MezuroPluginProjectControllerTest &lt; ActionController::TestCase
30 30 end
31 31  
32 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 34 get :project_state, :profile => @profile.identifier, :id => @content.id
35 35 assert_response 200
36 36 assert_equal "ERROR", @response.body
... ... @@ -38,7 +38,7 @@ class MezuroPluginProjectControllerTest &lt; ActionController::TestCase
38 38 end
39 39  
40 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 42 get :project_error, :profile => @profile.identifier, :id => @content.id
43 43 assert_response 200
44 44 assert_select('h3', 'ERROR')
... ... @@ -47,7 +47,7 @@ class MezuroPluginProjectControllerTest &lt; ActionController::TestCase
47 47 end
48 48  
49 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 51 get :project_result, :profile => @profile.identifier, :id => @content.id, :date => nil
52 52 assert_equal @content, assigns(:content)
53 53 assert_equal @project_result.project.name, assigns(:project_result).project.name
... ... @@ -57,8 +57,8 @@ class MezuroPluginProjectControllerTest &lt; ActionController::TestCase
57 57  
58 58 should 'test project results from a specific date' do
59 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 62 get :project_result, :profile => @profile.identifier, :id => @content.id, :date => @date
63 63 assert_equal @content, assigns(:content)
64 64 assert_equal @project_result.project.name, assigns(:project_result).project.name
... ... @@ -67,7 +67,7 @@ class MezuroPluginProjectControllerTest &lt; ActionController::TestCase
67 67 end
68 68  
69 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 71 Kalibro::Project.expects(:request).with("Project", :get_project, :project_name => @project.name).returns({:project => @project.to_hash})
72 72 get :project_tree, :profile => @profile.identifier, :id => @content.id, :module_name => @project.name, :date => nil
73 73 assert_equal @content, assigns(:content)
... ... @@ -80,8 +80,8 @@ class MezuroPluginProjectControllerTest &lt; ActionController::TestCase
80 80 should 'test project tree with a specific date' do
81 81 request_body = {:project_name => @project.name, :date => @project_result.date}
82 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 85 get :project_tree, :profile => @profile.identifier, :id => @content.id, :module_name => @project.name, :date => @project_result.date
86 86 assert_equal @content, assigns(:content)
87 87 assert_equal @project.name, assigns(:project_name)
... ...