Added check to not add already existing trackers in case some previous setup

step already added the same tracker
pull/179/head
Sebastian Schuster 12 years ago
parent 7b819d4045
commit 95fdd40782
  1. 4
      features/step_definitions/general_steps.rb

@ -384,7 +384,7 @@ Given /^I (?:stop|pause) (?:step )?execution$/ do
end end
end end
When /^(?:|I )login as (.+)?(?: with password )?(.+)?$/ do |username, password| When /^(?:|I )login as (.+)(?: with password (.+))?$/ do |username, password|
username = username.gsub("\"", "") username = username.gsub("\"", "")
password = password.nil? ? "admin" : password.gsub("\"", "") password = password.nil? ? "admin" : password.gsub("\"", "")
login(username, password) login(username, password)
@ -426,10 +426,12 @@ Given /^the [pP]roject(?: "([^\"]*)")? has the following trackers:$/ do |project
tracker.position = t['position'] ? t['position'] : i tracker.position = t['position'] ? t['position'] : i
tracker.is_in_roadmap = t['is_in_roadmap'] ? t['is_in_roadmap'] : true tracker.is_in_roadmap = t['is_in_roadmap'] ? t['is_in_roadmap'] : true
tracker.save! tracker.save!
if !p.trackers.include?(tracker)
p.trackers << tracker p.trackers << tracker
p.save! p.save!
end end
end end
end
def get_project(project_name = nil) def get_project(project_name = nil)
if project_name.blank? if project_name.blank?

Loading…
Cancel
Save