From 17ee95711baa4b6909eda5b38569de285300641a Mon Sep 17 00:00:00 2001 From: Renan Fichberg Date: Wed, 13 Nov 2013 16:14:51 -0200 Subject: [PATCH] Working on graphic acceptance test. --- features/repository/show.feature | 6 +++++- features/step_definitions/repository_steps.rb | 14 ++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/features/repository/show.feature b/features/repository/show.feature index 7990871..2f491b2 100644 --- a/features/repository/show.feature +++ b/features/repository/show.feature @@ -101,5 +101,9 @@ Feature: Show Repository 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 + And I ask for the metric results of the given module result + When I visit the repository show page And I see a sample metric's name - When I click on the sample metric's name \ No newline at end of file + When I click on the sample metric's name + diff --git a/features/step_definitions/repository_steps.rb b/features/step_definitions/repository_steps.rb index fd9ee9d..352fb23 100644 --- a/features/step_definitions/repository_steps.rb +++ b/features/step_definitions/repository_steps.rb @@ -8,11 +8,13 @@ Given(/^I have a sample configuration with native metrics$/) do end Given(/^I have a sample repository within the sample project$/) do - @repository = FactoryGirl.create(:repository, {project_id: @project.id, configuration_id: @configuration.id, id: nil}) + @repository = FactoryGirl.create(:repository, {project_id: @project.id, + configuration_id: @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, configuration_id: @configuration.id, id: nil, name: name}) + @repository = FactoryGirl.create(:repository, {project_id: @project.id, + configuration_id: @configuration.id, id: nil, name: name}) end Given(/^I start to process that repository$/) do @@ -47,12 +49,16 @@ Given(/^I ask for the module result of the given processing$/) do @module_result = ModuleResult.find @processing.results_root_id end +Given(/^I ask for the metric results of the given module result$/) do + @metric_results = @module_result.metric_results +end + Given(/^I see a sample metric's name$/) do - page.should have_content(metric_configuration.metric.name) + page.should have_content(@metric_results.first.metric_configuration_snapshot.metric.name) end When(/^I click on the sample metric's name$/) do - click_link @metric_configuration.metric.name + click_link @metric_results.first.metric_configuration_snapshot.metric.name end When(/^I set the select field "(.+)" as "(.+)"$/) do |field, text| -- libgit2 0.21.2