Fixed a bunch of tests

This commit is contained in:
Eric Allen 2009-10-09 21:27:27 -04:00
parent d9108abe92
commit e32b23c615
7 changed files with 22 additions and 9 deletions

View file

@ -19,4 +19,9 @@ else
page[dom_id(@project, 'edit')].hide
page.replace_html dom_id(@project, 'container'), :partial => 'project_settings', :locals => { :project => @project }
page[dom_id(@project)].show
page << "$('#todo_context_name').val('#{@project.default_context.name}');" if @project.default_context
page << "$('input[name=default_context_name]').val('#{@project.default_context.name}');" if @project.default_context
page << "defaultContexts = #{default_contexts_for_autocomplete};"
page << "defaultTags = #{default_tags_for_autocomplete};"
end

View file

@ -82,7 +82,8 @@ if @saved
elsif @todo_was_activated_from_deferred_state
page[@todo].remove
page['tickler-empty-nd'].show if (@deferred_count == 0)
page.insert_html :bottom, "p#{@todo.project_id}", :partial => 'todos/todo', :locals => { :todo => @todo, :parent_container_type => parent_container_type }
page.insert_html :bottom, "p#{@todo.project_id}items", :partial => 'todos/todo', :locals => { :todo => @todo, :parent_container_type => parent_container_type }
page.visual_effect :highlight, dom_id(@todo), :duration => 3
page["p#{@todo.project_id}empty-nd"].hide
page.replace_html "badge_count", @down_count
else

View file

@ -15,6 +15,6 @@ click "edit_icon_todo_15"
wait_for_element_present "show_from_todo_15"
type "show_from_todo_15", ""
click "css=#submit_todo_15"
wait_for_element_present "xpath=//div[@id='p1'] //div[@id='todo_15']"
wait_for_element_present "xpath=//div[@id='p1items'] //div[@id='todo_15']"
assert_not_visible "tickler-empty-nd"
assert_text 'badge_count', '2'

View file

@ -5,5 +5,5 @@ click "edit_icon_todo_15"
wait_for_element_present "show_from_todo_15"
type "show_from_todo_15", ""
click "css=#submit_todo_15"
wait_for_element_present "xpath=//div[@id='p1'] //div[@id='todo_15']"
wait_for_element_present "xpath=//div[@id='p1items'] //div[@id='todo_15']"
wait_for_visible "tickler-empty-nd"

View file

@ -5,7 +5,7 @@ open "/projects/1"
# add new todo
type "todo_description", "a brand new todo"
click "css=#todo-form-new-action .submit_box button"
wait_for_element_present "xpath=//div[@id='p1'] //div[@class='item-container']"
wait_for_element_present "xpath=//div[@id='p1items'] //div[@class='item-container']"
# wait for flash to mention that todo was added and verify existence of new todo
wait_for_visible "flash"

View file

@ -2,9 +2,12 @@ setup :fixtures => :all
login :as => 'admin'
open "/projects/2"
click 'css=.project_settings a'
wait_for_visible "project[default_context_name]"
# change default context
type "project[default_context_name]", "errand"
click "commit"
click "css=.positive"
wait_for_visible "flash"

View file

@ -1,14 +1,18 @@
setup :fixtures => :all
login :as => 'admin'
open '/projects/1'
click 'css=.project_settings a'
wait_for_visible "project[default_context_name]"
assert_checked 'project_state_active'
assert_attribute 'css=#project_status .active span', 'class', 'active_state'
assert_attribute 'css=#project_status .hidden span', 'class', 'inactive_state'
assert_text_present 'This project is active'
assert_text 'badge_count', '2'
click 'project_state_hidden'
wait_for_attribute 'css=#project_status .active span', 'class', 'inactive_state'
wait_for_attribute 'css=#project_status .hidden span', 'class', 'active_state'
click 'css=.positive'
wait_for_text_present 'marked as hidden'
assert_text 'badge_count', '2'
open '/projects/1'
assert_text 'badge_count', '2'
click 'css=.project_settings a'
wait_for_visible 'project_state_hidden'
assert_checked 'project_state_hidden'