adds selenium test for badge count in tag view. Also commits missing badge counting test for notes view.

git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@754 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
lrbalt 2008-03-19 21:04:55 +00:00
parent b21128576f
commit eae9927193
3 changed files with 40 additions and 1 deletions

View file

@ -29,7 +29,7 @@ module TodosHelper
parameters = "{ _source_view : '#{@source_view}' }"
end
str = link_to( image_tag_for_delete,
todo_path(@todo),
todo_path(@todo), :id => "delete_icon_"+@todo.id.to_s,
:class => "icon delete_icon", :title => "delete the action '#{@todo.description}'")
apply_behavior '.item-container a.delete_icon:click', :prevent_default => true do |page|
page.confirming "'Are you sure that you want to ' + this.title + '?'" do

View file

@ -0,0 +1,23 @@
setup :fixtures => :all
login :as => 'admin'
open "/notes/"
assert_text 'badge_count', '2'
# add new note
open "/projects/1"
click "css=#add_note_href"
type "css=#new_note_body", "new note"
click "add-new-note"
# check badge count is one more
open "/notes/"
assert_text 'badge_count', '3'
# delete note
click "css=#delete_note_1"
assert_confirmation "Are you sure that you want to delete the note '1'?"
# check badge decreased
wait_for_visible "flash"
wait_for_element_not_present "container_note_1"
assert_text 'badge_count', '2'

View file

@ -0,0 +1,16 @@
setup :fixtures => :all
login :as => 'admin'
open "/todos/tag/foo"
assert_text 'badge_count', '2'
click "css=#delete_icon_2"
assert_confirmation "Are you sure that you want to delete the action 'Call dinosaur exterminator'?"
wait_for_element_not_present "todo_2"
assert_text 'badge_count', '1'
# mark one complete
click "xpath=//div[@id='c1'] //div[@id='todo_1'] //input[@class='item-checkbox']"
wait_for_element_present "xpath=//div[@id='completed'] //div[@id='todo_1']"
assert_text 'badge_count', '0'