Commit ed9da4d5ba4200620b6f24f47b6c3342e4a5a617
Committed by
Heitor
1 parent
405fb885
Exists in
colab
and in
4 other branches
Improve KalibroConfig[...] show acceptance test
We were missing metric configuration listing behavior Signed off by: Rafael Reggiani Manzo <rr.manzo@gmail.com>
Showing
2 changed files
with
23 additions
and
1 deletions
Show diff stats
features/kalibro_configuration/show.feature
1 | Feature: Show Configuration | 1 | Feature: Show Configuration |
2 | - In order to know all the contents of a given configuration | 2 | + In order to know all the contents of a given configuration |
3 | As a regular user | 3 | As a regular user |
4 | I should be able to see each of them | 4 | I should be able to see each of them |
5 | 5 | ||
6 | @kalibro_configuration_restart | 6 | @kalibro_configuration_restart |
7 | Scenario: Checking configuration contents | 7 | Scenario: Checking configuration contents |
8 | Given I have a sample configuration | 8 | Given I have a sample configuration |
9 | + And I have a hotspot metric configuration | ||
10 | + And I have a tree metric configuration | ||
9 | When I am at the Sample Configuration page | 11 | When I am at the Sample Configuration page |
10 | Then the sample configuration should be there | 12 | Then the sample configuration should be there |
11 | \ No newline at end of file | 13 | \ No newline at end of file |
features/step_definitions/metric_configuration_steps.rb
@@ -23,6 +23,16 @@ Given(/^I have a sample configuration with MetricFu metrics$/) do | @@ -23,6 +23,16 @@ Given(/^I have a sample configuration with MetricFu metrics$/) do | ||
23 | kalibro_configuration_id: @kalibro_configuration.id}) | 23 | kalibro_configuration_id: @kalibro_configuration.id}) |
24 | end | 24 | end |
25 | 25 | ||
26 | +Given(/^I have a tree metric configuration$/) do | ||
27 | + @tree_metric_configuration = FactoryGirl.create(:metric_configuration_with_id, | ||
28 | + {kalibro_configuration_id: @kalibro_configuration.id, metric: FactoryGirl.build(:hotspot_metric)}) | ||
29 | +end | ||
30 | + | ||
31 | +Given(/^I have a hotspot metric configuration$/) do | ||
32 | + @hotspot_metric_configuration = FactoryGirl.create(:metric_configuration_with_id, | ||
33 | + {kalibro_configuration_id: @kalibro_configuration.id, metric: FactoryGirl.build(:pain)}) | ||
34 | +end | ||
35 | + | ||
26 | When(/^I visit the sample metric configuration edit page$/) do | 36 | When(/^I visit the sample metric configuration edit page$/) do |
27 | visit edit_kalibro_configuration_metric_configuration_path(kalibro_configuration_id: @metric_configuration.kalibro_configuration_id, id: @metric_configuration.id) | 37 | visit edit_kalibro_configuration_metric_configuration_path(kalibro_configuration_id: @metric_configuration.kalibro_configuration_id, id: @metric_configuration.id) |
28 | end | 38 | end |
@@ -56,6 +66,16 @@ Then(/^I should be at the choose metric page$/) do | @@ -56,6 +66,16 @@ Then(/^I should be at the choose metric page$/) do | ||
56 | expect(page).to have_content("Choose a metric from a Base Tool:") | 66 | expect(page).to have_content("Choose a metric from a Base Tool:") |
57 | end | 67 | end |
58 | 68 | ||
69 | +Then(/^the tree configuration should be there$/) do | ||
70 | + expect(page).to have_content(@tree_metric_configuration.metric.name) | ||
71 | + expect(page).to have_content(@tree_metric_configuration.metric.code) | ||
72 | +end | ||
73 | + | ||
74 | +Then(/^the hotspot configuration should be there$/) do | ||
75 | + expect(page).to have_content(@hotspot_metric_configuration.metric.name) | ||
76 | + expect(page).to have_content(@hotspot_metric_configuration.metric.code) | ||
77 | +end | ||
78 | + | ||
59 | When(/^I click destroy Metric Configuration$/) do | 79 | When(/^I click destroy Metric Configuration$/) do |
60 | find('#metrics').first(:link, "Destroy").click | 80 | find('#metrics').first(:link, "Destroy").click |
61 | end | 81 | end |