diff --git a/features/repository/show/modules_tree.feature b/features/repository/show/modules_tree.feature index 4305e34..7ae92dd 100644 --- a/features/repository/show/modules_tree.feature +++ b/features/repository/show/modules_tree.feature @@ -38,7 +38,7 @@ Feature: Repository modules tree And I should see "Granularity" And I should see "Grade" - # This test is broken under analizo 1.17.0: https://www.pivotaltracker.com/story/show/80377258 + # This test is broken under analizo 1.17.0: https://www.pivotaltracker.com/story/show/80377258 @wip @kalibro_configuration_restart @kalibro_processor_restart @javascript Scenario: Module navigation Given I am a regular user @@ -55,3 +55,19 @@ Feature: Repository modules tree And I click on the sample child's name And I wait for "5" seconds Then I should see a sample child's name + + @kalibro_configuration_restart @kalibro_processor_restart @javascript @wip + Scenario: Should show modules directories root when the process has been finished + Given I am a regular user + And I am signed in + And I have a sample project + And I have a sample configuration with MetricFu metrics + And I have a sample ruby repository within the sample project + And I start to process that repository + And I wait up for a ready processing + And I ask for the last ready processing of the given repository + And I ask for the module result of the given processing + When I visit the repository show page + And I click the "Modules Tree" h3 + And I wait for "5" seconds + Then I should see the given module result diff --git a/features/step_definitions/kalibro_configuration_steps.rb b/features/step_definitions/kalibro_configuration_steps.rb index 373d5ee..0f897a6 100644 --- a/features/step_definitions/kalibro_configuration_steps.rb +++ b/features/step_definitions/kalibro_configuration_steps.rb @@ -55,4 +55,4 @@ end Then(/^the sample configuration should be there$/) do expect(page).to have_content(@kalibro_configuration.name) expect(page).to have_content(@kalibro_configuration.description) -end \ No newline at end of file +end diff --git a/features/step_definitions/metric_configuration_steps.rb b/features/step_definitions/metric_configuration_steps.rb index 5330350..9dd0936 100644 --- a/features/step_definitions/metric_configuration_steps.rb +++ b/features/step_definitions/metric_configuration_steps.rb @@ -8,6 +8,17 @@ Given(/^I have a metric configuration with code "(.*?)" within the given mezuro {kalibro_configuration_id: @kalibro_configuration.id, reading_group_id: @reading_group.id, metric: FactoryGirl.build(:metric, code: code)}) end +Given(/^I have a sample configuration with MetricFu metrics$/) do + reading_group = FactoryGirl.create(:reading_group) + reading = FactoryGirl.create(:reading, {reading_group_id: reading_group.id}) + + @kalibro_configuration = FactoryGirl.create(:kalibro_configuration) + metric_configuration = FactoryGirl.create(:metric_configuration, + {metric: FactoryGirl.build(:pain), + reading_group_id: reading_group.id, + kalibro_configuration_id: @kalibro_configuration.id}) +end + When(/^I visit the sample metric configuration edit page$/) do visit edit_kalibro_configuration_metric_configuration_path(@metric_configuration.kalibro_configuration_id, @metric_configuration.id) end @@ -40,3 +51,4 @@ end Then(/^I should be at the choose metric page$/) do expect(page).to have_content("Choose a metric from a Base Tool:") end + diff --git a/features/step_definitions/repository_steps.rb b/features/step_definitions/repository_steps.rb index daa52e3..253ca89 100644 --- a/features/step_definitions/repository_steps.rb +++ b/features/step_definitions/repository_steps.rb @@ -26,6 +26,11 @@ Given(/^I have a sample repository within the sample project$/) do kalibro_configuration_id: @kalibro_configuration.id, id: nil}) end +Given(/^I have a sample ruby repository within the sample project$/) do + @repository = FactoryGirl.create(:ruby_repository, {project_id: @project.id, + kalibro_configuration_id: @kalibro_configuration.id, id: nil}) +end + Given(/^I have a sample repository within the sample project named "(.+)"$/) do |name| @repository = FactoryGirl.create(:repository, {project_id: @project.id, kalibro_configuration_id: @kalibro_configuration.id, id: nil, name: name}) @@ -169,3 +174,4 @@ Then(/^"(.*?)" should be lesser than "(.*?)"$/) do |arg1, arg2| expect(v1 < v2).to be_truthy end + diff --git a/spec/factories/metrics.rb b/spec/factories/metrics.rb index 608cfff..8ae7b10 100644 --- a/spec/factories/metrics.rb +++ b/spec/factories/metrics.rb @@ -21,6 +21,17 @@ FactoryGirl.define do initialize_with { new(name, code, scope, description, languages) } end + factory :pain, class: KalibroClient::Entities::Miscellaneous::NativeMetric do + name "Code Pain" + code "pain" + scope "CLASS" + description nil + languages { [:ruby] } + metric_collector_name "MetricFu" + + initialize_with { new(name, code, scope, description, languages) } + end + factory :compound_metric, class: KalibroClient::Entities::Miscellaneous::CompoundMetric do name "Compound" code "compound" diff --git a/spec/factories/repositories.rb b/spec/factories/repositories.rb index f179da5..0f7132f 100644 --- a/spec/factories/repositories.rb +++ b/spec/factories/repositories.rb @@ -27,6 +27,19 @@ FactoryGirl.define do send_email "test@test.com" end + factory :ruby_repository, class: Repository do + id 2 + name "KalibroConfigurations" + description "Kalibro Configurations" + license "GPLv3" + period 1 + scm_type "GIT" + address "https://github.com/mezuro/kalibro_processor.git" + kalibro_configuration_id 1 + project_id 1 + send_email "test@test.com" + end + factory :another_repository, parent: :repository do id 2 end -- libgit2 0.21.2