From fd5b8718396c9d241ac20eba33ddc63def8a8ffb Mon Sep 17 00:00:00 2001 From: lukemelia Date: Sun, 15 Apr 2007 23:04:16 +0000 Subject: [PATCH] Fix #500 (when moving an action to an empy context , a wrong message is shown). Thanks, lrbalt! git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@530 a4c988fc-2ded-0310-b66e-134b36920a42 --- tracks/app/views/todos/_edit_form.rhtml | 24 +++++++++---------- tracks/app/views/todos/update.rjs | 1 + ...nge_todo_context_to_zero_item_context.rsel | 11 +++++++++ 3 files changed, 24 insertions(+), 12 deletions(-) create mode 100644 tracks/test/selenium/home/change_todo_context_to_zero_item_context.rsel diff --git a/tracks/app/views/todos/_edit_form.rhtml b/tracks/app/views/todos/_edit_form.rhtml index 919b2392..eee22403 100644 --- a/tracks/app/views/todos/_edit_form.rhtml +++ b/tracks/app/views/todos/_edit_form.rhtml @@ -12,20 +12,10 @@ <%= text_area( "todo", "notes", "cols" => 20, "rows" => 5, "tabindex" => 9) %> - - - - - - - + + + + + + + <%= text_field_tag "tag_list", @todo.tags.collect{|t| t.name}.join(", "), :size => 40, :tabindex => 12 %> @@ -50,7 +50,7 @@ <% end -%> - + Cancel diff --git a/tracks/app/views/todos/update.rjs b/tracks/app/views/todos/update.rjs index 89ee1483..83fcf700 100644 --- a/tracks/app/views/todos/update.rjs +++ b/tracks/app/views/todos/update.rjs @@ -18,6 +18,7 @@ if @saved if source_view_is(:todo) && @todo.active? page.call "todoItems.ensureVisibleWithEffectAppear", "c#{@todo.context_id}" page.call "todoItems.expandNextActionListingByContext", "c#{@todo.context_id}items", true + page[empty_container_msg_div_id].hide unless empty_container_msg_div_id.nil? page.insert_html :bottom, "c#{@todo.context_id}items", :partial => 'todos/todo', :locals => { :parent_container_type => parent_container_type } end page.replace_html("badge_count", @remaining_undone_in_context) if source_view_is :context diff --git a/tracks/test/selenium/home/change_todo_context_to_zero_item_context.rsel b/tracks/test/selenium/home/change_todo_context_to_zero_item_context.rsel new file mode 100644 index 00000000..4ada1ad3 --- /dev/null +++ b/tracks/test/selenium/home/change_todo_context_to_zero_item_context.rsel @@ -0,0 +1,11 @@ +setup :fixtures => :all +login :as => 'admin' +open "/" +click "edit_icon_todo_12" +wait_for_visible "context_name_todo_12" +type "context_name_todo_12", "errand" +click "submit_todo_12" +wait_for_element_not_present "css=#c1 #todo_12" +wait_for_visible "c4" +wait_for_visible "css=#c4 #todo_12" +assert_not_visible "c4empty-nd"