remove dynamic finders from cucumber scenarios

This commit is contained in:
Reinier Balt 2013-02-27 20:02:01 +01:00
parent 2b2572a2d1
commit 48e47fc009
20 changed files with 133 additions and 134 deletions

View file

@ -112,14 +112,14 @@ module TracksStepHelper
end
def context_list_find_index(context_name)
div_id = "context_#{@current_user.contexts.find_by_name(context_name).id}"
div_id = "context_#{@current_user.contexts.where(:name => context_name).first.id}"
contexts = page.all("div.context").map { |x| x[:id] }
return contexts.find_index(div_id)
end
def project_list_find_index(project_name)
# TODO: refactor with context_list_find_index
div_id = "project_#{@current_user.projects.find_by_name(project_name).id}"
div_id = "project_#{@current_user.projects.where(:name => project_name).first.id}"
project = page.all("div.project").map { |x| x[:id] }
return project.find_index(div_id)
end