fix regressions

This commit is contained in:
Reinier Balt 2013-04-19 20:00:32 +02:00
parent d732779e14
commit a8e426a2cd
8 changed files with 24 additions and 16 deletions

View file

@ -67,10 +67,10 @@ module NavigationHelpers
@source_view = "review"
review_path(options)
when /the contexts page/
@source_view = "contexts"
@source_view = "context"
contexts_path(options)
when /the projects page/
@source_view = "projects"
@source_view = "project"
projects_path(options)
when /the manage users page/
users_path(options)

View file

@ -13,27 +13,35 @@ module TracksIdHelper
end
def project_container_xpath(project)
id = project.nil? ? "without_project_container" : "p#{project.id}"
id = project.nil? ? "without_project_container" : "p#{project.id}"
"//div[@id='#{id}']"
end
def deferred_container_xpath
"//div[@id='deferred_pending_container']"
end
def todo_line_xpath(todo)
"//div[@id='line_todo_#{todo.id}']"
end
def todo_in_container_xpath(todo, container_type)
id = "wrong"
id = todo_in_context_container_xpath(todo, todo.context) if container_type == :context
id = todo_in_project_container_xpath(todo, todo.project) if container_type == :project
return "//div[@id=\"#{id}\"]//div[@id='line_todo_#{todo.id}']"
id = "//div[@id=\"wrong\"]"
id = context_container_xpath(todo.context) if container_type == :context
id = project_container_xpath(todo.project) if container_type == :project
return "#{id}//div[@id='line_todo_#{todo.id}']"
end
def todo_in_context_container_xpath(todo, context)
"#{context_container_xpath(context)}//div[@id='line_todo_#{todo.id}']"
"#{context_container_xpath(context)}#{todo_line_xpath(todo)}"
end
def todo_in_project_container_xpath(todo, project)
return "#{project_container_xpath(project)}//div[@id='line_todo_#{todo.id}']"
"#{project_container_xpath(project)}#{todo_line_xpath(todo)}"
end
def todo_in_deferred_container_xpath(todo)
"//div[@id='deferred_pending_container']//div[@id='line_todo_#{todo.id}']"
"#{deferred_container_xpath}#{todo_line_xpath(todo)}"
end
end