From 022a94f6869b17a447c7bfee1887e1b2a7dab6d0 Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Wed, 13 Jan 2010 21:17:17 +0100 Subject: [PATCH] fix test where today and show_from did not have the same timezone and add test for OneNote links inspired by the tests for Mail.app links --- test/functional/todos_controller_test.rb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test/functional/todos_controller_test.rb b/test/functional/todos_controller_test.rb index 25d397f4..855b8397 100644 --- a/test/functional/todos_controller_test.rb +++ b/test/functional/todos_controller_test.rb @@ -447,7 +447,7 @@ class TodosControllerTest < ActionController::TestCase assert !new_todo.show_from.nil? next_month = today + 1.month - assert_equal next_month.to_date.to_s(:db), new_todo.show_from.to_date.to_s(:db) + assert_equal next_month.utc.to_date.to_s(:db), new_todo.show_from.utc.to_date.to_s(:db) end def test_check_for_next_todo @@ -550,4 +550,15 @@ class TodosControllerTest < ActionController::TestCase assert_select("div#notes_todo_#{todo.id} a", 'message://<ABCDEF-GHADB-123455-FOO-BAR@example.com>') assert_select("div#notes_todo_#{todo.id} a[href=message://<ABCDEF-GHADB-123455-FOO-BAR@example.com>]", 'message://<ABCDEF-GHADB-123455-FOO-BAR@example.com>') end + + def test_format_note_link_onenote + login_as(:admin_user) + todo = users(:admin_user).todos.first + todo.notes = ' "link me to onenote":onenote:///E:\OneNote\dir\notes.one#PAGE§ion-id={FD597D3A-3793-495F-8345-23D34A00DD3B}&page-id={1C95A1C7-6408-4804-B3B5-96C28426022B}&end' + todo.save! + get :index + assert_select("div#notes_todo_#{todo.id}", 'link me to onenote') + assert_select("div#notes_todo_#{todo.id} a", 'link me to onenote') + assert_select("div#notes_todo_#{todo.id} a[href=onenote:///E:\\OneNote\\dir\\notes.one#PAGE&section-id={FD597D3A-3793-495F-8345-23D34A00DD3B}&page-id={1C95A1C7-6408-4804-B3B5-96C28426022B}&end]", 'link me to onenote') + end end