Skip to content

Commit

Permalink
Added unit test for correct behaviour of {{barchart}} and {{barchart …
Browse files Browse the repository at this point in the history
…stacked compact negative}}
  • Loading branch information
ElliotJH committed Aug 12, 2013
1 parent e1d1e62 commit f7d04b8
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/unit/helpers/govspeak_helper_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,28 @@ class GovspeakHelperTest < ActionView::TestCase
end
end

test 'will add a barchart class to a marked table' do
input = '
|col|
|---|
|val|
{barchart}
'
html = govspeak_to_html(input)
assert_select_within_html html, "table.js-barchart-table"
end

test 'will add a stacked, compact, negative barchart class to a marked table' do
input = '
|col|
|---|
|val|
{barchart stacked compact negative}
'
html = govspeak_to_html(input)
assert_select_within_html html, "table.mc-stacked.js-barchart-table.mc-negative.compact"
end

private

def internal_preview_host
Expand Down

0 comments on commit f7d04b8

Please sign in to comment.