Merge branch 'master' of git://github.com/bsag/tracks

This commit is contained in:
Reinier Balt 2008-12-03 14:07:33 +01:00
commit e743dd79c3
1641 changed files with 90344 additions and 58968 deletions

View file

@ -223,8 +223,8 @@ class ProjectsControllerTest < TodoContainerControllerTestBase
login_as :admin_user
u = users(:admin_user)
post :actionize, :state => "active", :format => 'js'
assert_equal 1, projects(:gardenclean).position
assert_equal 2, projects(:moremoney).position
assert_equal 2, projects(:gardenclean).position
assert_equal 1, projects(:moremoney).position
assert_equal 3, projects(:timemachine).position
end

View file

@ -184,7 +184,7 @@ class TodosControllerTest < Test::Rails::TestCase
assert_xml_select 'rss[version="2.0"]' do
assert_select 'channel' do
assert_select '>title', 'Tracks Actions'
assert_select '>title', 'Actions'
assert_select '>description', "Actions for #{users(:admin_user).display_name}"
assert_select 'language', 'en-us'
assert_select 'ttl', '40'
@ -205,7 +205,7 @@ class TodosControllerTest < Test::Rails::TestCase
assert_xml_select 'rss[version="2.0"]' do
assert_select 'channel' do
assert_select '>title', 'Tracks Actions'
assert_select '>title', 'Actions'
assert_select '>description', "Actions for #{users(:admin_user).display_name}"
assert_select 'item', 5 do
assert_select 'title', /.+/
@ -240,7 +240,7 @@ class TodosControllerTest < Test::Rails::TestCase
# #puts @response.body
assert_xml_select 'feed[xmlns="http://www.w3.org/2005/Atom"]' do
assert_xml_select '>title', 'Tracks Actions'
assert_xml_select '>title', 'Actions'
assert_xml_select '>subtitle', "Actions for #{users(:admin_user).display_name}"
assert_xml_select 'entry', 11 do
assert_xml_select 'title', /.+/
@ -450,7 +450,7 @@ class TodosControllerTest < Test::Rails::TestCase
# check that the new_todo is in the tickler to show next month
assert !new_todo.show_from.nil?
assert_equal Time.utc(today.year, today.month+1, today.day), new_todo.show_from
assert_equal Time.utc(today.year, today.month, today.day)+1.month, new_todo.show_from
end
def test_check_for_next_todo

View file

@ -20,8 +20,9 @@ class ContextXmlApiTest < ActionController::IntegrationTest
end
def test_fails_with_invalid_xml_format
authenticated_post_xml_to_context_create "<foo></bar>"
assert_equal 500, @integration_session.status
# Fails too hard for test to catch
# authenticated_post_xml_to_context_create "<foo></bar>"
# assert_equal 500, @integration_session.status
end
def test_fails_with_invalid_xml_format2

View file

@ -20,8 +20,9 @@ class ProjectXmlApiTest < ActionController::IntegrationTest
end
def test_fails_with_invalid_xml_format
authenticated_post_xml_to_project_create "<foo></bar>"
assert_equal 500, @integration_session.status
#Fails too hard for test to catch
# authenticated_post_xml_to_project_create "<foo></bar>"
# assert_equal 500, @integration_session.status
end
def test_fails_with_invalid_xml_format2

View file

@ -28,11 +28,12 @@ class UsersXmlApiTest < ActionController::IntegrationTest
authenticated_post_xml_to_user_create @@foobar_postdata, users(:admin_user).login, 'abracadabra', {'CONTENT_TYPE' => "application/x-www-form-urlencoded"}
assert_404_invalid_xml
end
def test_fails_with_invalid_xml_format
authenticated_post_xml_to_user_create "<foo></bar>"
assert_equal 500, @integration_session.status
end
# Fails too hard for test to catch
# def test_fails_with_invalid_xml_format
# authenticated_post_xml_to_user_create "<foo></bar>"
# assert_equal 500, @integration_session.status
# end
def test_fails_with_invalid_xml_format2
authenticated_post_xml_to_user_create "<request><username>foo</username></request>"

View file

@ -18,4 +18,7 @@ click "css=#toggle_c1"
wait_for_not_visible "todo_9"
# check that newly added action is not there
wait_for_not_visible "xpath=//span[text()='a new action']"
wait_for_not_visible "xpath=//span[text()='a new action']"
# toggle c1 back. Selenium does not reset cookies
click "css=#toggle_c1"

View file

@ -3,7 +3,7 @@ login :as => 'admin'
open "/"
# we should start with 10 actions on home page
assert_text 'badge_count', '10'
assert_text 'badge_count', '11'
# set project to hidden state
open "/projects/2"
@ -28,4 +28,4 @@ wait_for_visible "flash"
verify_text_not_present 'should be hidden'
# badge count should still be same
assert_text 'badge_count', '7'
assert_text 'badge_count', '7'

View file

@ -6,4 +6,4 @@ wait_for_element_present "show_from_todo_9"
type "show_from_todo_9", "1/1/2030"
click "css=#submit_todo_9"
wait_for_element_not_present "todo_9"
assert_text 'badge_count', '9'
assert_text 'badge_count', '10'

View file

@ -6,5 +6,5 @@ wait_for_element_present "show_from_todo_5"
type "show_from_todo_5", "1/1/2030"
click "css=#submit_todo_5"
wait_for_element_not_present "todo_5"
assert_text 'badge_count', '9'
assert_text 'badge_count', '10'
wait_for_not_visible "c5"

View file

@ -1,8 +1,8 @@
setup :fixtures => :all
login :as => 'admin'
open "/"
wait_for_element_present '//div[@id="line_todo_5"]//img[@alt="Defer_1"]/..'
click '//div[@id="line_todo_5"]//img[@alt="Defer_1"]/..'
wait_for_element_present '//div[@id="line_todo_5"]//img[@alt="Defer 1 day"]/..'
click '//div[@id="line_todo_5"]//img[@alt="Defer 1 day"]/..'
wait_for_element_not_present "todo_5"
assert_text 'badge_count', '9'
assert_text 'badge_count', '10'
wait_for_not_visible "c5"

View file

@ -2,7 +2,7 @@ setup :fixtures => :all
login :as => 'admin'
open '/m'
wait_for_text 'css=h1 span.count', '10'
wait_for_text 'css=h1 span.count', '11'
click_and_wait "link=0-Add new action"
@ -15,4 +15,4 @@ select "todo_due_2i", "label=January"
select "todo_due_1i", "label=2009"
click_and_wait "//input[@value='Create']"
wait_for_text 'css=h1 span.count', '11'
wait_for_text 'css=h1 span.count', '12'

View file

@ -2,10 +2,12 @@ setup :fixtures => :all
login :as => 'admin'
open '/m'
wait_for_text 'css=h1 span.count', '10'
wait_for_text 'css=h1 span.count', '11'
open '/todos/6.m'
wait_for_page_to_load 3000
open_and_wait '/todos/6.m'
click "done"
click_and_wait "//input[@value='Update']"
wait_for_text 'css=h1 span.count', '9'
wait_for_text 'css=h1 span.count', '10'

View file

@ -4,14 +4,14 @@ login :as => 'admin'
# open home page
open '/m'
wait_for_title "All actions"
wait_for_text 'css=h1 span.count', '10'
wait_for_text 'css=h1 span.count', '11'
# open context page
click_and_wait "link=2-Contexts"
# verify_title "All actions in context agenda"
# choose agenda context
click_and_wait "link=agenda"
wait_for_text 'css=h1 span.count', '5'
wait_for_text 'css=h1 span.count', '6'
# click on tag foo to go to tag page
click_and_wait "link=foo"

View file

@ -1,7 +1,7 @@
setup :fixtures => :all
login :as => 'admin'
open '/projects/1'
assert_checked 'project_state_active', 'ignored'
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 'badge_count', '2'
@ -11,4 +11,4 @@ wait_for_attribute 'css=#project_status .hidden span', 'class', 'active_state'
assert_text 'badge_count', '2'
open '/projects/1'
assert_text 'badge_count', '2'
assert_checked 'project_state_hidden', 'ignored'
assert_checked 'project_state_hidden'

View file

@ -20,4 +20,4 @@ assert_text 'badge_count', '4'
open '/projects/1'
assert_text 'badge_count', '4'
assert_checked 'project_state_hidden', 'ignored'
assert_checked 'project_state_hidden'

View file

@ -51,4 +51,10 @@ module SeleniumOnRails::TestBuilderAccessors
yield
wait_for_context_count "${expected_context_count}"
end
end
def click_and_wait clickable
click clickable
wait_for_page_to_load 3000
end
end

View file

@ -67,6 +67,7 @@ class PrototypeHelperExtensionsTest < Test::Unit::TestCase
def protect_against_forgery?
false
end
attr_accessor :output_buffer
end