Commit 74359d6d560bf3291db3069008a6610394d69db0
Committed by
Rafael Manzo
1 parent
f63c5c24
Exists in
colab
and in
4 other branches
Added acceptance test for the case of a repository processing without ranges
Showing
5 changed files
with
37 additions
and
3 deletions
Show diff stats
.gitignore
features/repository/show/metric_results.feature
| @@ -23,6 +23,23 @@ Feature: Repository metric results | @@ -23,6 +23,23 @@ Feature: Repository metric results | ||
| 23 | When I wait up for the ajax request | 23 | When I wait up for the ajax request |
| 24 | Then I should see "There is only one point and it will not be printed into a chart." | 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 | # TODO: Scenario: Should show the graphic of a given metric | 43 | # TODO: Scenario: Should show the graphic of a given metric |
| 27 | # It was getting really difficult to test this because of Poltergeist's timeouts | 44 | # It was getting really difficult to test this because of Poltergeist's timeouts |
| 28 | # so we gave up on this for now | 45 | # so we gave up on this for now |
| 29 | \ No newline at end of file | 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,6 +37,3 @@ Then(/^I should see the sample range$/) do | ||
| 37 | expect(page).to have_content(@mezuro_range.beginning) | 37 | expect(page).to have_content(@mezuro_range.beginning) |
| 38 | expect(page).to have_content(@mezuro_range.end) | 38 | expect(page).to have_content(@mezuro_range.end) |
| 39 | end | 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 | Given(/^I have a sample configuration with native metrics$/) do | 13 | Given(/^I have a sample configuration with native metrics$/) do |
| 2 | reading_group = FactoryGirl.create(:reading_group, id: nil) | 14 | reading_group = FactoryGirl.create(:reading_group, id: nil) |
| 3 | reading = FactoryGirl.create(:reading, {id: nil, group_id: reading_group.id}) | 15 | reading = FactoryGirl.create(:reading, {id: nil, group_id: reading_group.id}) |
| @@ -0,0 +1,7 @@ | @@ -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 | \ No newline at end of file | 8 | \ No newline at end of file |