test/metamagic_test.rb in metamagic-3.0.0.beta1 vs test/metamagic_test.rb in metamagic-3.0.0.beta2
- old
+ new
@@ -1,9 +1,9 @@
require 'test_helper'
class HelperMethodsTest < ActionView::TestCase
- include Metamagic::HelperMethods
+ include Metamagic::ViewHelper
test "meta tags generation" do
meta title: "My Title",
description: "My description.",
keywords: ["One", "Two", "Three"]
@@ -63,8 +63,20 @@
first: "This is the first",
second: "This is the second"
}
assert_equal %{<title>Test Title</title>\n<custom_tag one="custom:first" two="This is the first" />\n<custom_tag one="custom:second" two="This is the second" />},
+ metamagic
+ end
+
+ test "shortcut helpers" do
+ title "My Title"
+ description "My description"
+ keywords %w{one two three}
+ og image: "http://test.com/img.jpg"
+ twitter card: :summary, site: "@flickr"
+ meta bla: "Test"
+
+ assert_equal %{<title>My Title</title>\n<meta content="My description" name="description" />\n<meta content="one, two, three" name="keywords" />\n<meta content="http://test.com/img.jpg" property="og:image" />\n<meta content="summary" property="twitter:card" />\n<meta content="@flickr" property="twitter:site" />\n<meta content="Test" name="bla" />},
metamagic
end
end