diff --git a/tracks/app/views/shared/_add_new_item_form.rhtml b/tracks/app/views/shared/_add_new_item_form.rhtml index 0b0d279e..74646014 100644 --- a/tracks/app/views/shared/_add_new_item_form.rhtml +++ b/tracks/app/views/shared/_add_new_item_form.rhtml @@ -58,14 +58,28 @@ Event.observe($('todo_project_name'), "blur", selectDefaultContext.bind($('todo_
diff --git a/tracks/app/views/todos/create.rjs b/tracks/app/views/todos/create.rjs index c12e0f96..d0639077 100644 --- a/tracks/app/views/todos/create.rjs +++ b/tracks/app/views/todos/create.rjs @@ -7,7 +7,7 @@ if @saved page.notify :notice, status_message, 5.0 page['badge_count'].replace_html @down_count page.send :record, "Form.reset('todo-form-new-action');Form.focusFirstElement('todo-form-new-action')" - page << "contextAutoCompleter.options.array = #{context_names_for_autocomplete}" if @new_context_created + page << "updateContextNamesForAutoComplete(#{context_names_for_autocomplete})" if @new_context_created page << "projectAutoCompleter.options.array = #{project_names_for_autocomplete}" if @new_project_created if should_show_new_item() if @new_context_created diff --git a/tracks/test/selenium/home/create_first_todo.rsel b/tracks/test/selenium/home/create_first_todo.rsel new file mode 100644 index 00000000..578ee8ee --- /dev/null +++ b/tracks/test/selenium/home/create_first_todo.rsel @@ -0,0 +1,9 @@ +setup :fixtures => :users, :clear_tables => [:projects, :contexts, :todos] +login :as => 'admin' +open "/" +store_eval "this.browserbot.getCurrentWindow().$$('.context').length", 'initial_context_count' +type "todo_description", "a new action" +type "todo_context_name", "Brand new context" +click "css=#todo-form-new-action .submit_box button" +store_eval "${initial_context_count} + 1", 'expected_context_count' +wait_for_eval "this.browserbot.getCurrentWindow().$$('.context').length", "${expected_context_count}" diff --git a/tracks/test/selenium/home/create_new_todo_with_new_context.rsel b/tracks/test/selenium/home/create_new_todo_with_new_context.rsel new file mode 100644 index 00000000..0a72e302 --- /dev/null +++ b/tracks/test/selenium/home/create_new_todo_with_new_context.rsel @@ -0,0 +1,9 @@ +setup :fixtures => :all +login :as => 'admin' +open "/" +store_eval "this.browserbot.getCurrentWindow().$$('.context').length", 'initial_context_count' +type "todo_description", "a new action" +type "todo_context_name", "Brand new context" +click "css=#todo-form-new-action .submit_box button" +store_eval "${initial_context_count} + 1", 'expected_context_count' +wait_for_eval "this.browserbot.getCurrentWindow().$$('.context').length", "${expected_context_count}"