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. 8
      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,8 +426,10 @@ 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!
p.trackers << tracker if !p.trackers.include?(tracker)
p.save! p.trackers << tracker
p.save!
end
end end
end end

Loading…
Cancel
Save