diff --git a/app/helpers/repository_helper.rb b/app/helpers/repository_helper.rb index 0ad378b..ffb45ee 100644 --- a/app/helpers/repository_helper.rb +++ b/app/helpers/repository_helper.rb @@ -6,4 +6,8 @@ module RepositoryHelper def license_options YAML.load_file("config/licenses.yml").split("; ") end + + def periodicity_option(periodicity) + periodicity_options.select {|option| option.last == periodicity}.first.first + end end \ No newline at end of file diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index f81e46a..a30fea3 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -3,11 +3,31 @@

+ Description: + <%= @repository.description %> +

+ +

+ License: + <%= @repository.license %> +

+ +

+ Type: + <%= @repository.type %> +

+ +

Address: <%= @repository.address %>

+ Periodicity: + <%= periodicity_option(@repository.process_period) %> +

+ +

Configuration: <%= @configuration.name %>

diff --git a/features/repository/edit.feature b/features/repository/edit.feature index 662c7c8..fb58478 100644 --- a/features/repository/edit.feature +++ b/features/repository/edit.feature @@ -16,12 +16,16 @@ Feature: Repository Edit Then the field "Name" should be filled with "QtCalculator" And the field "Type" should be filled with "SUBVERSION" And the field "Address" should be filled with "svn://svn.code.sf.net/p/qt-calculator/code/trunk" + And I set the select field "Process Period" as "Weekly" + And I set the select field "License" as "EU DataGrid Software License (EUDatagrid)" When I fill the Name field with "MedSquare" And I set the select field "Type" as "GIT" And I fill the Address field with "git://git.code.sf.net/p/medsquare/git" And I press the Save button Then I should see "MedSquare" And I should see "git://git.code.sf.net/p/medsquare/git" + And I should see "Weekly" + And I should see "EU DataGrid Software License (EUDatagrid)" @kalibro_restart Scenario: editing a repository with blank fields diff --git a/features/repository/show.feature b/features/repository/show.feature index 2b3ebeb..5cd905c 100644 --- a/features/repository/show.feature +++ b/features/repository/show.feature @@ -3,6 +3,22 @@ Feature: Show Repository As a regular user I should see it's informations + @kalibro_restart @javascript @wip + Scenario: Testing the repository values + Given 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 "Address" + And I should see "Configuration" + And I should see "Periodicity" + And I should see "Type" + And I should see "Description" + And I should see "License" + And I should see the given repository's content + @kalibro_restart @javascript Scenario: With a ready processing Given I am a regular user @@ -14,19 +30,20 @@ Feature: Show Repository And I wait up for a ready processing When I visit the repository show page Then I should see the sample repository name - And I should see "Address" - And I should see "Configuration" And I should see "State" And I should see "Creation date" And I should see "LOADING time" And I should see "COLLECTING time" And I should see "ANALYZING time" - #TODO: test if the module results tree is getting rendered When I click the "Metric Results" h3 Then I should see "Metric" And I should see "Value" And I should see "Weight" And I should see "Threshold" + When I click the "Modules Tree" h3 + Then I should see "Name" + And I should see "Granularity" + And I should see "Grade" @kalibro_restart @javascript Scenario: Just after start to process diff --git a/features/step_definitions/repository_steps.rb b/features/step_definitions/repository_steps.rb index c6012f5..ce03988 100644 --- a/features/step_definitions/repository_steps.rb +++ b/features/step_definitions/repository_steps.rb @@ -97,6 +97,13 @@ Then(/^I should see a sample child's name$/) do page.should have_content(@module_result.children.first.module.name) end +Then(/^I should see the given repository's content$/) do + page.should have_content(@repository.type) + page.should have_content(@repository.description) + page.should have_content(@repository.name) + page.should have_content(@repository.license) +end + Then(/^I should see a loaded graphic for the sample metric$/) do while (page.driver.network_traffic.last.response_parts.empty?) do sleep(10) diff --git a/spec/helpers/repository_helper_spec.rb b/spec/helpers/repository_helper_spec.rb index 3c81eee..a95daa5 100644 --- a/spec/helpers/repository_helper_spec.rb +++ b/spec/helpers/repository_helper_spec.rb @@ -13,4 +13,10 @@ describe RepositoryHelper do helper.license_options.should eq YAML.load_file("config/licenses.yml").split("; ") end end + + describe 'periodicity_option' do + it 'should return the periodicity option associated to the given number' do + helper.periodicity_option(1).should eq "1 day" + end + end end \ No newline at end of file -- libgit2 0.21.2