Refactored TodosController#create method by introducing class to make it easier to work with the creation params.

git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@628 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
lukemelia 2007-11-04 23:06:46 +00:00
parent 11fb7c5b0e
commit 6156f26c47
7 changed files with 228 additions and 36 deletions

View file

@ -19,5 +19,17 @@ class PreferenceTest < Test::Rails::TestCase
assert @other_user.preference.show_project_on_todo_done
assert !@admin_user.preference.show_project_on_todo_done
end
def test_parse_date
assert_equal Date.new(2007, 5, 20).to_s, @admin_user.preference.parse_date('20/5/2007').to_s
end
def test_parse_date_returns_nil_if_string_is_empty
assert_nil @admin_user.preference.parse_date('')
end
def test_parse_date_returns_nil_if_string_is_nil
assert_nil @admin_user.preference.parse_date(nil)
end
end