From 075a83989a39ec290d228d49c112be1b7c2a0ae0 Mon Sep 17 00:00:00 2001 From: Heitor Reis Date: Tue, 10 Feb 2015 15:59:23 -0200 Subject: [PATCH] Adding a creation feature to test for duplicated codes --- features/compound_metric_configuration/create.feature | 21 ++++++++++++++++++++- features/compound_metric_configuration/edition.feature | 3 +-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/features/compound_metric_configuration/create.feature b/features/compound_metric_configuration/create.feature index f5c0df9..d1fde0f 100644 --- a/features/compound_metric_configuration/create.feature +++ b/features/compound_metric_configuration/create.feature @@ -24,9 +24,28 @@ Feature: Compound Metric Configuration Creation And I set the select field "Scope" as "Class" And I set the select field "Reading Group" as "Scholar" And I press the Save button - And I take a picture of the page When I click the show link of "My Compound Metric" Then I should see "My Compound Metric" And I should see "mcm" And I should see "8" + @kalibro_configuration_restart @javascript + Scenario: compound metric configuration creation with same code + Given I am a regular user + And I am signed in + And I own a sample configuration + And I have a reading group named "Scholar" + And I have another compound metric configuration with code "Another_Code" within the given mezuro configuration + And I am at the Sample Configuration page + And I click the Add Metric link + And I click the Compound Metric link + When I fill the Name field with "My Compound Metric" + And I fill the Description field with "Some description" + And I fill the Code field with "Another_Code" + And I fill the Script field with "8*8;" + And I fill the Weight field with "8" + And I set the select field "Scope" as "Class" + And I set the select field "Reading Group" as "Scholar" + When I press the Save button + Then I should see "Code must be unique within a kalibro configuration" + diff --git a/features/compound_metric_configuration/edition.feature b/features/compound_metric_configuration/edition.feature index 8bebf3a..8002a9c 100644 --- a/features/compound_metric_configuration/edition.feature +++ b/features/compound_metric_configuration/edition.feature @@ -63,5 +63,4 @@ Feature: Compound Metric Configuration edition When I visit the sample compound metric configuration edit page And I fill the Code field with "Another_Code" And I press the Save button - And I take a picture of the page - Then I should see "Code There is already a MetricConfiguration with code Another_Code! Please, choose another one." + Then I should see "Code must be unique within a kalibro configuration" -- libgit2 0.21.2