several fixes to recurring todos and adds some named_scopes

fixes case where unmarking a complete todo which belongs to a recurring pattern results in two todos that both keep on recurring. With this fix a new todo will only be created when there are no active todos left belonging to that recurring pattern

fixes tests that failed because of previous commits

adds some named_scopes, inspired by http://railscasts.com/episodes/108
This commit is contained in:
Reinier Balt 2008-11-28 16:39:50 +01:00
parent bd2b410c7b
commit 4a98ee5669
8 changed files with 55 additions and 31 deletions

View file

@ -180,7 +180,7 @@ class TodosControllerTest < Test::Rails::TestCase
login_as(:admin_user)
get :index, { :format => "rss" }
assert_equal 'application/rss+xml', @response.content_type
# #puts @response.body
# puts @response.body
assert_xml_select 'rss[version="2.0"]' do
assert_select 'channel' do
@ -193,7 +193,7 @@ class TodosControllerTest < Test::Rails::TestCase
assert_select 'description', /.*/
assert_select 'link', %r{http://test.host/contexts/.+}
assert_select 'guid', %r{http://test.host/todos/.+}
assert_select 'pubDate', projects(:timemachine).updated_at.to_s(:rfc822)
assert_select 'pubDate', todos(:book).updated_at.to_s(:rfc822)
end
end
end
@ -245,7 +245,7 @@ class TodosControllerTest < Test::Rails::TestCase
assert_xml_select 'entry', 11 do
assert_xml_select 'title', /.+/
assert_xml_select 'content[type="html"]', /.*/
assert_xml_select 'published', /(#{Regexp.escape(projects(:timemachine).updated_at.xmlschema)}|#{Regexp.escape(projects(:moremoney).updated_at.xmlschema)})/
assert_xml_select 'published', /(#{Regexp.escape(todos(:book).updated_at.xmlschema)}|#{Regexp.escape(projects(:moremoney).updated_at.xmlschema)})/
end
end
end