From d2e8b214200f519a63b0ec671471cfad761b30d4 Mon Sep 17 00:00:00 2001 From: fllsouto Date: Mon, 28 Oct 2013 20:00:08 -0200 Subject: [PATCH] Starting acceptance tests for module result --- app/models/module_result.rb | 3 +++ app/views/repositories/show.html.erb | 7 ++++++- features/repository/show.feature | 42 +++++++++++++++++++++++++++++++++++++++++- features/step_definitions/repository_steps.rb | 12 ++++++++++++ 4 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 app/models/module_result.rb diff --git a/app/models/module_result.rb b/app/models/module_result.rb new file mode 100644 index 0000000..d14b9fc --- /dev/null +++ b/app/models/module_result.rb @@ -0,0 +1,3 @@ +class ModuleResult < KalibroEntities::Entities::ModuleResult + include KalibroRecord +end \ No newline at end of file diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index 67ccca2..eb51f73 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -34,8 +34,13 @@

<% end %> <% end %> -
+

Source Tree

+<% if @processing.ready? %> +

<%= @module_result.module.name %>

+
  • +
  • +<% end %> <% if @processing.ready? %> diff --git a/features/repository/show.feature b/features/repository/show.feature index f61ab04..89fdd5c 100644 --- a/features/repository/show.feature +++ b/features/repository/show.feature @@ -43,4 +43,44 @@ Feature: Show Repository And I should not see Metric And I should not see Value And I should not see Weight - And I should not see Threshold \ No newline at end of file + And I should not see Threshold + + @kalibro_restart + Scenario: Should show modules title + Given I am a regular user + And I am signed in + And I have a sample project + And I have a sample configuration with native metrics + And I have a sample repository within the sample project + And I start to process that repository + And I wait up for a ready processing + When I visit the repository show page + Then I should see "Source Tree" + + @kalibro_restart + 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 native metrics + And I have a sample 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 + Then I should see the given module result + + @kalibro_restart + Scenario: Should show childrens of 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 native metrics + And I have a sample 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 + Then I should see the given module result \ No newline at end of file diff --git a/features/step_definitions/repository_steps.rb b/features/step_definitions/repository_steps.rb index 5da9a82..68202ba 100644 --- a/features/step_definitions/repository_steps.rb +++ b/features/step_definitions/repository_steps.rb @@ -39,6 +39,14 @@ Given(/^I am at repository edit page$/) do visit edit_project_repository_path(@repository.project_id, @repository.id) end +Given(/^I ask for the last ready processing of the given repository$/) do + @processing = Processing.last_ready_processing_of @repository.id +end + +Given(/^I ask for the module result of the given processing$/) do + @module_result = ModuleResult.find @processing.results_root_id +end + When(/^I set the select field "(.+)" as "(.+)"$/) do |field, text| select text, from: field end @@ -54,3 +62,7 @@ end Then(/^the field "(.*?)" should be filled with "(.*?)"$/) do |field, value| page.find_field(field).value.should eq(value) end + +Then(/^I should see the given module result$/) do + page.should have_content(@module_result.module.name) +end \ No newline at end of file -- libgit2 0.21.2