diff --git a/tracks/app/helpers/todos_helper.rb b/tracks/app/helpers/todos_helper.rb index 3185b725..e1f922f0 100644 --- a/tracks/app/helpers/todos_helper.rb +++ b/tracks/app/helpers/todos_helper.rb @@ -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 diff --git a/tracks/test/selenium/notes/badge_count.rsel b/tracks/test/selenium/notes/badge_count.rsel new file mode 100644 index 00000000..7bb0c442 --- /dev/null +++ b/tracks/test/selenium/notes/badge_count.rsel @@ -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' diff --git a/tracks/test/selenium/tags/badge_count.rsel b/tracks/test/selenium/tags/badge_count.rsel new file mode 100644 index 00000000..56cd9f84 --- /dev/null +++ b/tracks/test/selenium/tags/badge_count.rsel @@ -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'