diff --git a/features/kalibro_configuration/show.feature b/features/kalibro_configuration/show.feature index 592e6af..6d045b2 100644 --- a/features/kalibro_configuration/show.feature +++ b/features/kalibro_configuration/show.feature @@ -1,10 +1,12 @@ Feature: Show Configuration - In order to know all the contents of a given configuration + In order to know all the contents of a given configuration As a regular user I should be able to see each of them @kalibro_configuration_restart Scenario: Checking configuration contents Given I have a sample configuration + And I have a hotspot metric configuration + And I have a tree metric configuration When I am at the Sample Configuration page Then the sample configuration should be there \ No newline at end of file diff --git a/features/step_definitions/metric_configuration_steps.rb b/features/step_definitions/metric_configuration_steps.rb index cc4d1f4..65dd644 100644 --- a/features/step_definitions/metric_configuration_steps.rb +++ b/features/step_definitions/metric_configuration_steps.rb @@ -23,6 +23,16 @@ Given(/^I have a sample configuration with MetricFu metrics$/) do kalibro_configuration_id: @kalibro_configuration.id}) end +Given(/^I have a tree metric configuration$/) do + @tree_metric_configuration = FactoryGirl.create(:metric_configuration_with_id, + {kalibro_configuration_id: @kalibro_configuration.id, metric: FactoryGirl.build(:hotspot_metric)}) +end + +Given(/^I have a hotspot metric configuration$/) do + @hotspot_metric_configuration = FactoryGirl.create(:metric_configuration_with_id, + {kalibro_configuration_id: @kalibro_configuration.id, metric: FactoryGirl.build(:pain)}) +end + When(/^I visit the sample metric configuration edit page$/) do visit edit_kalibro_configuration_metric_configuration_path(kalibro_configuration_id: @metric_configuration.kalibro_configuration_id, id: @metric_configuration.id) end @@ -56,6 +66,16 @@ Then(/^I should be at the choose metric page$/) do expect(page).to have_content("Choose a metric from a Base Tool:") end +Then(/^the tree configuration should be there$/) do + expect(page).to have_content(@tree_metric_configuration.metric.name) + expect(page).to have_content(@tree_metric_configuration.metric.code) +end + +Then(/^the hotspot configuration should be there$/) do + expect(page).to have_content(@hotspot_metric_configuration.metric.name) + expect(page).to have_content(@hotspot_metric_configuration.metric.code) +end + When(/^I click destroy Metric Configuration$/) do find('#metrics').first(:link, "Destroy").click end -- libgit2 0.21.2