Introduce selenium tests to help get the ajax interactions correct and maintainable.

Start to improve the ajax interactions around the new deferred actions section on the project detail page
Add a README for developers describing how to run the selenium tests.


git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@387 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
lukemelia 2007-01-02 00:19:57 +00:00
parent 71df0f1061
commit bde8a0bde0
170 changed files with 35512 additions and 25 deletions

View file

@ -100,20 +100,25 @@ class TodoController < ApplicationController
@item = check_user_return_item
@item.toggle_completion()
@saved = @item.save
if @saved
@remaining_undone_in_context = @user.contexts.find(@item.context_id).not_done_todo_count
determine_down_count
determine_completed_count
end
return if request.xhr?
if @saved
# TODO: I think this will work, but can't figure out how to test it
notify :notice, "The action <strong>'#{@item.description}'</strong> was marked as <strong>#{@item.completed? ? 'complete' : 'incomplete' }</strong>"
redirect_to :action => "index"
else
notify :notice, "The action <strong>'#{@item.description}'</strong> was NOT marked as <strong>#{@item.completed? ? 'complete' : 'incomplete' } due to an error on the server.</strong>", "index"
redirect_to :action => "index"
respond_to do |format|
format.js do
if @saved
@remaining_undone_in_context = @user.contexts.find(@item.context_id).not_done_todo_count
determine_down_count
determine_completed_count
end
render
end
format.html do
if @saved
# TODO: I think this will work, but can't figure out how to test it
notify :notice, "The action <strong>'#{@item.description}'</strong> was marked as <strong>#{@item.completed? ? 'complete' : 'incomplete' }</strong>"
redirect_to :action => "index"
else
notify :notice, "The action <strong>'#{@item.description}'</strong> was NOT marked as <strong>#{@item.completed? ? 'complete' : 'incomplete' } due to an error on the server.</strong>", "index"
redirect_to :action => "index"
end
end
end
end