Skip to content

Instantly share code, notes, and snippets.

@ssoriche
Created April 8, 2012 15:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssoriche/2337755 to your computer and use it in GitHub Desktop.
Save ssoriche/2337755 to your computer and use it in GitHub Desktop.
Failing Hash Ref Tag Helper
use Test::More tests => 72;
use Test::Mojo;
{
package Foo;
use Mojo::Base 'Mojolicious';
sub startup {
my $self = shift;
my $r = $self->routes;
$r->route('links')->via('GET','POST');
}
1;
}
my $t = Test::Mojo->new('Foo');
$t->get_ok('/links')->status_is(200)->content_is(<<EOF);
<a href="/path">Pa&lt;th</a>
<a href="http://example.com/" title="Foo">Foo</a>
<a href="http://example.com/"><foo>Example</foo></a>
<a href="/links">Home</a>
<a href="/form/23" title="Foo">Foo</a>
EOF
__DATA__
@@ links.html.ep
<%= link_to 'Pa<th' => '/path' %>
<%= link_to 'http://example.com/', title => 'Foo', sub { 'Foo' } %>
<%= link_to 'http://example.com/' => begin %><foo>Example</foo><% end %>
<%= link_to Home => 'links' %>
<%= link_to Foo => 'form', {test => 23}, title => 'Foo' %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment