mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-15 13:48:51 +01:00
Linkify message:// URLs in notes. Those links are used by Mail.app on
Mac OS X to link to a mail message by message id.
This commit is contained in:
parent
e844b5aa5b
commit
5299490c83
5 changed files with 69 additions and 5 deletions
|
|
@ -510,4 +510,44 @@ class TodosControllerTest < ActionController::TestCase
|
|||
assert_select("a[href=#{url}]")
|
||||
end
|
||||
|
||||
def test_format_note_normal
|
||||
login_as(:admin_user)
|
||||
todo = users(:admin_user).todos.first
|
||||
todo.notes = "A normal description."
|
||||
todo.save!
|
||||
get :index
|
||||
assert_select("div#notes_todo_#{todo.id}", "A normal description.")
|
||||
end
|
||||
|
||||
def test_format_note_markdown
|
||||
login_as(:admin_user)
|
||||
todo = users(:admin_user).todos.first
|
||||
todo.notes = "A *bold description*."
|
||||
todo.save!
|
||||
get :index
|
||||
assert_select("div#notes_todo_#{todo.id}", "A bold description.")
|
||||
assert_select("div#notes_todo_#{todo.id} strong", "bold description")
|
||||
end
|
||||
|
||||
def test_format_note_link
|
||||
login_as(:admin_user)
|
||||
todo = users(:admin_user).todos.first
|
||||
todo.notes = "A link to http://github.com/."
|
||||
todo.save!
|
||||
get :index
|
||||
assert_select("div#notes_todo_#{todo.id}", 'A link to http://github.com/.')
|
||||
assert_select("div#notes_todo_#{todo.id} a[href=http://github.com/]", 'http://github.com/')
|
||||
end
|
||||
|
||||
def test_format_note_link_message
|
||||
login_as(:admin_user)
|
||||
todo = users(:admin_user).todos.first
|
||||
todo.notes = "A Mail.app message://<ABCDEF-GHADB-123455-FOO-BAR@example.com> link"
|
||||
todo.save!
|
||||
get :index
|
||||
# puts css_select("div#notes_todo_#{todo.id}")
|
||||
assert_select("div#notes_todo_#{todo.id}", 'A Mail.app message://<ABCDEF-GHADB-123455-FOO-BAR@example.com> link')
|
||||
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
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue