Commit 74359d6d560bf3291db3069008a6610394d69db0

Authored by Renan Fichberg
Committed by Rafael Manzo
1 parent f63c5c24

Added acceptance test for the case of a repository processing without ranges

.gitignore
... ... @@ -27,3 +27,4 @@ KalibroService/
27 27 analizo_1.16.0_all.deb
28 28 db_bootstrap.sql
29 29 install.sh
  30 +kalibro_gatekeeper.yml
... ...
features/repository/show/metric_results.feature
... ... @@ -23,6 +23,23 @@ Feature: Repository metric results
23 23 When I wait up for the ajax request
24 24 Then I should see "There is only one point and it will not be printed into a chart."
25 25  
  26 + @kalibro_restart @kalibro_processor_restart @javascript
  27 + Scenario: Should show the no range message after a process without range
  28 + Given I am a regular user
  29 + And I am signed in
  30 + And I have a sample project
  31 + And I have a sample configuration with native metrics but without ranges
  32 + And I have a sample repository within the sample project
  33 + And I start to process that repository
  34 + And I wait up for a ready processing
  35 + And I ask for the last ready processing of the given repository
  36 + And I ask for the module result of the given processing
  37 + And I ask for the metric results of the given module result
  38 + When I visit the repository show page
  39 + And I click the "Metric Results" h3
  40 + And I see a sample metric's name
  41 + Then I should see "Missing range"
  42 +
26 43 # TODO: Scenario: Should show the graphic of a given metric
27 44 # It was getting really difficult to test this because of Poltergeist's timeouts
28 45 # so we gave up on this for now
29 46 \ No newline at end of file
... ...
features/step_definitions/mezuro_range_steps.rb
... ... @@ -37,6 +37,3 @@ Then(/^I should see the sample range$/) do
37 37 expect(page).to have_content(@mezuro_range.beginning)
38 38 expect(page).to have_content(@mezuro_range.end)
39 39 end
40   -
41   -
42   -
... ...
features/step_definitions/repository_steps.rb
  1 +Given(/^I have a sample configuration with native metrics but without ranges$/) do
  2 + reading_group = FactoryGirl.create(:reading_group, id: nil)
  3 + reading = FactoryGirl.create(:reading, {id: nil, group_id: reading_group.id})
  4 + @mezuro_configuration = FactoryGirl.create(:mezuro_configuration, id: nil)
  5 + metric_configuration = FactoryGirl.create(:metric_configuration,
  6 + {id: nil,
  7 + metric: FactoryGirl.build(:loc),
  8 + reading_group_id: reading_group.id,
  9 + configuration_id: @mezuro_configuration.id,
  10 + code: 'loc'})
  11 +end
  12 +
1 13 Given(/^I have a sample configuration with native metrics$/) do
2 14 reading_group = FactoryGirl.create(:reading_group, id: nil)
3 15 reading = FactoryGirl.create(:reading, {id: nil, group_id: reading_group.id})
... ...
features/support/hooks.rb 0 → 100644
... ... @@ -0,0 +1,7 @@
  1 +After do |scenario|
  2 +# Do something after each scenario.
  3 +# The +scenario+ argument is optional, but
  4 +# if you use it, you can inspect status with
  5 +# the #failed?, #passed? and #exception methods.
  6 +Rails.cache.clear
  7 +end
0 8 \ No newline at end of file
... ...