From 95fdd407824bec0279dc7d410c73d114e3c38c09 Mon Sep 17 00:00:00 2001 From: Sebastian Schuster Date: Wed, 12 Jun 2013 10:22:24 +0200 Subject: [PATCH] Added check to not add already existing trackers in case some previous setup step already added the same tracker --- features/step_definitions/general_steps.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/features/step_definitions/general_steps.rb b/features/step_definitions/general_steps.rb index f49f636748..9a53c80d43 100644 --- a/features/step_definitions/general_steps.rb +++ b/features/step_definitions/general_steps.rb @@ -384,7 +384,7 @@ Given /^I (?:stop|pause) (?:step )?execution$/ do end end -When /^(?:|I )login as (.+)?(?: with password )?(.+)?$/ do |username, password| +When /^(?:|I )login as (.+)(?: with password (.+))?$/ do |username, password| username = username.gsub("\"", "") password = password.nil? ? "admin" : password.gsub("\"", "") login(username, password) @@ -426,8 +426,10 @@ Given /^the [pP]roject(?: "([^\"]*)")? has the following trackers:$/ do |project tracker.position = t['position'] ? t['position'] : i tracker.is_in_roadmap = t['is_in_roadmap'] ? t['is_in_roadmap'] : true tracker.save! - p.trackers << tracker - p.save! + if !p.trackers.include?(tracker) + p.trackers << tracker + p.save! + end end end