From 1aff374cd5ddbc052f5d44604aad4324dbecfe41 Mon Sep 17 00:00:00 2001 From: Diego Araújo + Paulo Meirelles Date: Wed, 10 Oct 2012 18:05:32 -0300 Subject: [PATCH] [Mezuro] Trying to fix acceptance tests. --- plugins/mezuro/features/adding_metric_configuration.feature | 4 ++-- plugins/mezuro/features/echo_port_test.rb | 90 ------------------------------------------------------------------------------------------ plugins/mezuro/features/editing_configuration.feature | 4 ++-- plugins/mezuro/features/removing_metric_configuration.feature | 2 +- 4 files changed, 5 insertions(+), 95 deletions(-) delete mode 100644 plugins/mezuro/features/echo_port_test.rb diff --git a/plugins/mezuro/features/adding_metric_configuration.feature b/plugins/mezuro/features/adding_metric_configuration.feature index 6995fd1..dc85558 100644 --- a/plugins/mezuro/features/adding_metric_configuration.feature +++ b/plugins/mezuro/features/adding_metric_configuration.feature @@ -8,13 +8,13 @@ Feature: Add metric configuration to a configuration | joaosilva | Joao Silva | And I am logged in as "joaosilva" And "Mezuro" plugin is enabled - And I go to the Control panel + And I go to the Control panel And I create a Mezuro configuration with the following data | Title | My Configuration | | Description | A sample description | Scenario: adding a native metric configuration - When I follow "Add metric" + When I follow "Add Metric" And I follow "Analizo" And I follow "Lines of Code" And I fill in the following: diff --git a/plugins/mezuro/features/echo_port_test.rb b/plugins/mezuro/features/echo_port_test.rb deleted file mode 100644 index af7e73d..0000000 --- a/plugins/mezuro/features/echo_port_test.rb +++ /dev/null @@ -1,90 +0,0 @@ -require "test_helper" - -require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/base_tool_fixtures" -require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/configuration_fixtures" -require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/module_result_fixtures" -require "#{RAILS_ROOT}/plugins/mezuro/test/fixtures/project_result_fixtures" - -class EchoPortTest < ActiveSupport::TestCase - - def setup - @port = Kalibro::Client::Port.new('Echo') - address = YAML.load_file("#{RAILS_ROOT}/plugins/mezuro/service.yml") - address['KalibroService'] = 'KalibroFake' - @port.service_address=(address); - end - - should 'echo base tool' do - test BaseToolFixtures.analizo, 'BaseTool' do |base_tool| - base_tool.name = "echo " + base_tool.name - end - end - - should 'echo configuration' do - test ConfigurationFixtures.kalibro_configuration, 'Configuration' do |configuration| - configuration.name = "echo " + configuration.name - end - end - - should 'echo metric configuration' do - test_metric_configuration(MetricConfigurationFixtures.amloc_configuration) - test_metric_configuration(MetricConfigurationFixtures.sc_configuration) - end - - should 'echo module result' do - test ModuleResultFixtures.create, 'ModuleResult' do |module_result| - module_result.module.name = "echo." + module_result.module.name - end - end - - should 'echo project' do - test(ProjectFixtures.qt_calculator, 'Project') do |project| - project.name = "echo " + project.name - end - end - - should 'echo project result' do - test(ProjectResultFixtures.qt_calculator, 'ProjectResult') do |project_result| - project_result.project.name = "echo " + project_result.project.name - end - end - - should 'echo raw project' do - project = ProjectFixtures.qt_calculator - echoed = @port.request(:echo_raw_project, {:project => project.to_hash})[:project] - project.name = "echo " + project.name - project.state = nil - project.error = nil - assert_equal project, Kalibro::Entities::Project.from_hash(echoed) - end - - should 'work with enums' do - test_granularity("METHOD", "CLASS") - test_granularity("CLASS", "PACKAGE") - test_granularity("PACKAGE", "PACKAGE") - test_granularity("APPLICATION", "APPLICATION") - end - - private - - def test_metric_configuration(fixture) - test fixture, 'MetricConfiguration' do |metric_configuration| - metric_configuration.code = "echo_" + metric_configuration.code - end - end - - def test(fixture, entity_name) - entity_symbol = entity_name.underscore.to_sym - request_body = {entity_symbol => fixture.to_hash} - echoed = @port.request("echo_#{entity_symbol}".to_sym, request_body)[entity_symbol] - yield fixture - entity_class = "Kalibro::Entities::#{entity_name}".constantize - assert_equal fixture, entity_class.from_hash(echoed) - end - - def test_granularity(granularity, parent) - body = {:granularity => granularity} - assert_equal parent, @port.request(:infer_parent_granularity, body)[:parent_granularity] - end - -end diff --git a/plugins/mezuro/features/editing_configuration.feature b/plugins/mezuro/features/editing_configuration.feature index 07c79d1..68b9153 100644 --- a/plugins/mezuro/features/editing_configuration.feature +++ b/plugins/mezuro/features/editing_configuration.feature @@ -1,6 +1,6 @@ Feature: editing a configuration As a mezuro user - I want to edit a Kalibro configuration + I want to edit a Mezuro configuration Background: Given the following users @@ -13,7 +13,7 @@ Feature: editing a configuration | mycommunity | My Community | And "Joao Silva" is admin of "My Community" And I am on My Community's cms - And I create a content of type "Kalibro configuration" with the following data + And I create a content of type "Mezuro configuration" with the following data | Title | My Configuration | | Description | A sample description | And I follow "Add metric" diff --git a/plugins/mezuro/features/removing_metric_configuration.feature b/plugins/mezuro/features/removing_metric_configuration.feature index 88f635c..9ad9f62 100644 --- a/plugins/mezuro/features/removing_metric_configuration.feature +++ b/plugins/mezuro/features/removing_metric_configuration.feature @@ -13,7 +13,7 @@ Feature: Remove a metric configuration from a configuration | mycommunity | My Community | And "Joao Silva" is admin of "My Community" And I am on My Community's cms - And I create a content of type "Kalibro configuration" with the following data + And I create a content of type "Mezuro configuration" with the following data | Title | My Configuration | | Description | A sample description | When I follow "Add metric" -- libgit2 0.21.2