Skip to content

Commit

Permalink
Combined wiki/note grids (#4056)
Browse files Browse the repository at this point in the history
* Combined wiki/note grids

* add test
  • Loading branch information
Valentina Tironi authored and jywarren committed Nov 26, 2018
1 parent 7e8ba8e commit cb1b998
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/unit/node_shared_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
require 'test_helper'

class NodeSharedTest < ActiveSupport::TestCase
test 'that NodeShared can be used to convert short codes like [nodes:foo] into tables which list nodes and wikis(pages)' do
before = "Here are some nodes in a table: \n\n[nodes:test] \n\nThis is how you make it work:\n\n`[nodes:tagname]`\n\n `[nodes:tagname]`\n\nMake sense?"
html = NodeShared.nodes_grid(before)
assert html
assert_equal 1, html.scan('<table class="table inline-grid nodes-grid nodes-grid-test nodes-grid-test-').length
assert_equal 1, html.scan('<table').length
assert_equal 5, html.scan('nodes-grid-test').length
assert html.scan('<td class="author">').length > 1
end

test 'that NodeShared can be used to convert short codes like [notes:foo] into tables which list notes' do
before = "Here are some notes in a table: \n\n[notes:test] \n\nThis is how you make it work:\n\n`[notes:tagname]`\n\n `[notes:tagname]`\n\nMake sense?"
html = NodeShared.notes_grid(before)
Expand Down

0 comments on commit cb1b998

Please sign in to comment.