spec/components_spec.rb in inky-rb-1.3.8.0 vs spec/components_spec.rb in inky-rb-1.4.2.0

- old
+ new

@@ -29,23 +29,23 @@ it "applies the class float-center to <item> elements" do input = '<center><menu><item href="#"></item></menu></center>' expected = <<-HTML <center> - <table class="float-center menu " align="center"> + <table class="float-center menu " align="center"><tbody> <tr> <td> - <table> + <table><tbody> <tr> <th class="float-center menu-item"> <a href="#"></a> </th> </tr> - </table> + </tbody></table> </td> </tr> - </table> + </tbody></table> </center> HTML compare(input, expected) end @@ -53,79 +53,79 @@ RSpec.describe "Button" do it "creates a simple button" do input = '<button href="http://zurb.com">Button</button>' expected = <<-HTML - <table class="button"> + <table class="button"><tbody> <tr> <td> - <table> + <table><tbody> <tr> <td><a href="http://zurb.com">Button</a></td> </tr> - </table> + </tbody></table> </td> </tr> - </table> + </tbody></table> HTML compare(input, expected) end it 'creates a button with target="_blank" attribute' do input = '<button href="http://zurb.com" target="_blank">Button</button>' expected = <<-HTML - <table class="button"> + <table class="button"><tbody> <tr> <td> - <table> + <table><tbody> <tr> <td><a href="http://zurb.com" target="_blank">Button</a></td> </tr> - </table> + </tbody></table> </td> </tr> - </table> + </tbody></table> HTML compare(input, expected) end it 'creates a button with classes' do input = '<button class="small alert" href="http://zurb.com">Button</button>' expected = <<-HTML - <table class="button small alert"> + <table class="button small alert"><tbody> <tr> <td> - <table> + <table><tbody> <tr> <td><a href="http://zurb.com">Button</a></td> </tr> - </table> + </tbody></table> </td> </tr> - </table> + </tbody></table> HTML compare(input, expected) end it 'creates a correct expanded button' do input = '<button class="expand" href="http://zurb.com">Button</button>' expected = <<-HTML - <table class="button expand"> + <table class="button expand"><tbody> <tr> <td> - <table> + <table><tbody> <tr> <td> <center><a href="http://zurb.com" align="center" class="float-center">Button</a></center> </td> </tr> - </table> + </tbody></table> </td> <td class="expander"></td> </tr> - </table> + </tbody></table> HTML compare(input, expected) end end @@ -136,21 +136,21 @@ <menu> <item href="http://zurb.com">Item</item> </menu> INKY expected = <<-HTML - <table class="menu"> + <table class="menu"><tbody> <tr> <td> - <table> + <table><tbody> <tr> <th class="menu-item"><a href="http://zurb.com">Item</a></th> </tr> - </table> + </tbody></table> </td> </tr> - </table> + </tbody></table> HTML compare(input, expected) end @@ -159,21 +159,21 @@ <menu> <item href="http://zurb.com" target="_blank">Item</item> </menu> INKY expected = <<-HTML - <table class="menu"> + <table class="menu"><tbody> <tr> <td> - <table> + <table><tbody> <tr> <th class="menu-item"><a href="http://zurb.com" target="_blank">Item</a></th> </tr> - </table> + </tbody></table> </td> </tr> - </table> + </tbody></table> HTML compare(input, expected) end @@ -181,20 +181,20 @@ input = <<-INKY <menu class="vertical"> </menu> INKY expected = <<-HTML - <table class="menu vertical"> + <table class="menu vertical"><tbody> <tr> <td> - <table> + <table><tbody> <tr> </tr> - </table> + </tbody></table> </td> </tr> - </table> + </tbody></table> HTML compare(input, expected) end @@ -203,51 +203,51 @@ <menu> <th class="menu-item"><a href="http://zurb.com">Item 1</a></th> </menu> INKY expected = <<-HTML - <table class="menu"> + <table class="menu"><tbody> <tr> <td> - <table> + <table><tbody> <tr> <th class="menu-item"><a href="http://zurb.com">Item 1</a></th> </tr> - </table> + </tbody></table> </td> </tr> - </table> + </tbody></table> HTML compare(input, expected) end end RSpec.describe "Callout" do it "creates a callout with correct syntax" do input = '<callout>Callout</callout>' expected = <<-HTML - <table class="callout"> + <table class="callout"><tbody> <tr> <th class="callout-inner">Callout</th> <th class="expander"></th> </tr> - </table> + </tbody></table> HTML compare(input, expected) end it "copies classes to the final HTML" do input = '<callout class="primary">Callout</callout>' expected = <<-HTML - <table class="callout"> + <table class="callout"><tbody> <tr> <th class="callout-inner primary">Callout</th> <th class="expander"></th> </tr> - </table> + </tbody></table> HTML compare(input, expected) end end @@ -257,11 +257,11 @@ input = '<spacer size="10"></spacer>' expected = <<-HTML <table class="spacer"> <tbody> <tr> - <td height="10" style="font-size:10px;line-height:10px;">&#xA0;</td> + <td height="10" style="font-size:10px;line-height:10px;">&nbsp;</td> </tr> </tbody> </table> HTML @@ -272,11 +272,11 @@ input = '<spacer size-sm="10"></spacer>' expected = <<-HTML <table class="spacer hide-for-large"> <tbody> <tr> - <td height="10" style="font-size:10px;line-height:10px;">&#xA0;</td> + <td height="10" style="font-size:10px;line-height:10px;">&nbsp;</td> </tr> </tbody> </table> HTML @@ -287,11 +287,11 @@ input = '<spacer size-lg="20"></spacer>' expected = <<-HTML <table class="spacer show-for-large"> <tbody> <tr> - <td height="20" style="font-size:20px;line-height:20px;">&#xA0;</td> + <td height="20" style="font-size:20px;line-height:20px;">&nbsp;</td> </tr> </tbody> </table> HTML @@ -302,18 +302,18 @@ input = '<spacer size-sm="10" size-lg="20"></spacer>' expected = <<-HTML <table class="spacer hide-for-large"> <tbody> <tr> - <td height="10" style="font-size:10px;line-height:10px;">&#xA0;</td> + <td height="10" style="font-size:10px;line-height:10px;">&nbsp;</td> </tr> </tbody> </table> <table class="spacer show-for-large"> <tbody> <tr> - <td height="20" style="font-size:20px;line-height:20px;">&#xA0;</td> + <td height="20" style="font-size:20px;line-height:20px;">&nbsp;</td> </tr> </tbody> </table> HTML @@ -324,11 +324,11 @@ input = '<spacer size="10" class="bgcolor"></spacer>' expected = <<-HTML <table class="spacer bgcolor"> <tbody> <tr> - <td height="10" style="font-size:10px;line-height:10px;">&#xA0;</td> + <td height="10" style="font-size:10px;line-height:10px;">&nbsp;</td> </tr> </tbody> </table> HTML @@ -338,14 +338,14 @@ RSpec.describe "Wrapper" do it 'creates a wrapper that you can attach classes to' do input = '<wrapper class="header"></wrapper>' expected = <<-HTML - <table class="wrapper header" align="center"> + <table class="wrapper header" align="center"><tbody> <tr> <td class="wrapper-inner"></td> </tr> - </table> + </tbody></table> HTML compare(input, expected) end end