Commit 5d1f706aa922933309c808401e76523639ef5818
1 parent
2a9bb593
Exists in
master
and in
29 other branches
[Mezuro] Fix tests using fixtures
Showing
10 changed files
with
30 additions
and
8 deletions
Show diff stats
plugins/mezuro/test/mezuro_test.rb
plugins/mezuro/test/unit/kalibro/client/base_tool_client_test.rb
1 | 1 | require "test_helper" |
2 | + | |
3 | +require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/base_tool_fixtures" | |
4 | + | |
2 | 5 | class BaseToolClientTest < ActiveSupport::TestCase |
3 | 6 | |
4 | 7 | def setup |
... | ... | @@ -25,7 +28,7 @@ class BaseToolClientTest < ActiveSupport::TestCase |
25 | 28 | end |
26 | 29 | |
27 | 30 | should 'get base tool by name' do |
28 | - analizo = BaseToolTest.analizo | |
31 | + analizo = BaseToolFixtures.analizo | |
29 | 32 | request_body = {:base_tool_name => 'Analizo'} |
30 | 33 | @port.expects(:request).with(:get_base_tool, request_body).returns({:base_tool => analizo.to_hash}) |
31 | 34 | assert_equal analizo, @client.base_tool('Analizo') | ... | ... |
plugins/mezuro/test/unit/kalibro/client/configuration_client_test.rb
1 | 1 | require "test_helper" |
2 | + | |
3 | +require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/configuration_fixtures" | |
4 | + | |
2 | 5 | class ConfigurationClientTest < ActiveSupport::TestCase |
3 | 6 | |
4 | 7 | def setup |
... | ... | @@ -8,7 +11,7 @@ class ConfigurationClientTest < ActiveSupport::TestCase |
8 | 11 | end |
9 | 12 | |
10 | 13 | should 'save configuration' do |
11 | - configuration = ConfigurationTest.kalibro_configuration | |
14 | + configuration = ConfigurationFixtures.kalibro_configuration | |
12 | 15 | @port.expects(:request).with(:save_configuration, {:configuration => configuration.to_hash}) |
13 | 16 | @client.save(configuration) |
14 | 17 | end |
... | ... | @@ -31,7 +34,7 @@ class ConfigurationClientTest < ActiveSupport::TestCase |
31 | 34 | end |
32 | 35 | |
33 | 36 | should 'get configuration by name' do |
34 | - configuration = ConfigurationTest.kalibro_configuration | |
37 | + configuration = ConfigurationFixtures.kalibro_configuration | |
35 | 38 | request_body = {:configuration_name => configuration.name} |
36 | 39 | response_hash = {:configuration => configuration.to_hash} |
37 | 40 | @port.expects(:request).with(:get_configuration, request_body).returns(response_hash) | ... | ... |
plugins/mezuro/test/unit/kalibro/client/kalibro_client_test.rb
plugins/mezuro/test/unit/kalibro/client/module_result_client_test.rb
1 | 1 | require "test_helper" |
2 | + | |
3 | +require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/module_result_fixtures" | |
4 | + | |
2 | 5 | class ModuleResultClientTest < ActiveSupport::TestCase |
3 | 6 | |
4 | 7 | def setup |
5 | 8 | @port = mock |
6 | 9 | Kalibro::Client::Port.expects(:new).with('ModuleResult').returns(@port) |
7 | 10 | @client = Kalibro::Client::ModuleResultClient.new |
8 | - @result = ModuleResultTest.fixture | |
11 | + @result = ModuleResultFixtures.create | |
9 | 12 | end |
10 | 13 | |
11 | 14 | should 'get module result' do | ... | ... |
plugins/mezuro/test/unit/kalibro/client/port_test.rb
plugins/mezuro/test/unit/kalibro/client/project_client_test.rb
1 | 1 | require "test_helper" |
2 | + | |
3 | +require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/project_fixtures" | |
4 | + | |
2 | 5 | class ProjectClientTest < ActiveSupport::TestCase |
3 | 6 | |
4 | 7 | def setup |
... | ... | @@ -8,7 +11,7 @@ class ProjectClientTest < ActiveSupport::TestCase |
8 | 11 | end |
9 | 12 | |
10 | 13 | should 'save project' do |
11 | - project = ProjectTest.qt_calculator | |
14 | + project = ProjectFixtures.qt_calculator | |
12 | 15 | @port.expects(:request).with(:save_project, {:project => project.to_hash}) |
13 | 16 | @client.save(project) |
14 | 17 | end |
... | ... | @@ -31,7 +34,7 @@ class ProjectClientTest < ActiveSupport::TestCase |
31 | 34 | end |
32 | 35 | |
33 | 36 | should 'get project by name' do |
34 | - project = ProjectTest.qt_calculator | |
37 | + project = ProjectFixtures.qt_calculator | |
35 | 38 | request_body = {:project_name => project.name} |
36 | 39 | response_hash = {:project => project.to_hash} |
37 | 40 | @port.expects(:request).with(:get_project, request_body).returns(response_hash) | ... | ... |
plugins/mezuro/test/unit/kalibro/client/project_result_client_test.rb
1 | 1 | require "test_helper" |
2 | + | |
3 | +require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/configuration_fixtures" | |
4 | + | |
2 | 5 | class ProjectResultClientTest < ActiveSupport::TestCase |
3 | 6 | |
4 | 7 | def setup |
... | ... | @@ -6,7 +9,7 @@ class ProjectResultClientTest < ActiveSupport::TestCase |
6 | 9 | Kalibro::Client::Port.expects(:new).with('ProjectResult').returns(@port) |
7 | 10 | @client = Kalibro::Client::ProjectResultClient.new |
8 | 11 | |
9 | - @result = ProjectResultTest.qt_calculator | |
12 | + @result = ProjectResultFixtures.qt_calculator | |
10 | 13 | @project_name = @result.project.name |
11 | 14 | @date = @result.date |
12 | 15 | @flag = DateTime.now.sec % 2 == 0 | ... | ... |
plugins/mezuro/test/unit/mezuro_plugin/project_content_test.rb
1 | 1 | require "test_helper" |
2 | + | |
3 | +require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/project_fixtures" | |
4 | + | |
2 | 5 | class ProjectContentTest < ActiveSupport::TestCase |
3 | 6 | |
4 | 7 | def setup |
5 | - @project = ProjectTest.qt_calculator | |
8 | + @project = ProjectFixtures.qt_calculator | |
6 | 9 | @content = MezuroPlugin::ProjectContent.new |
7 | 10 | @content.name = @project.name |
8 | 11 | @content.license = @project.license | ... | ... |