Permalink
Browse files

Render image tag

  • Loading branch information...
1 parent 1787e66 commit 6c0d531269baf0fccf61bd203d70a832391872a3 Joe Fiorini committed Jan 15, 2010
Showing with 9 additions and 0 deletions.
  1. +2 −0 lib/totally_tabular/html_helper.rb
  2. +7 −0 spec/lib/totally_tabular/html_helper_spec.rb
@@ -7,6 +7,8 @@ def tag(tag, content="", attributes={})
"<br>"
when "input"
"<input>"
+ when "img"
+ "<img>"
when /^\w+$/
if attributes.any?
attr_string =
@@ -29,6 +29,10 @@
@helper.tag(:input).should == "<input>"
end
+ it "returns an empty img tag" do
+ @helper.tag(:img).should == "<img>"
+ end
+
it "returns a tag with content" do
@helper.tag(:strong, "blah").should == "<strong>blah</strong>"
end
@@ -45,4 +49,7 @@
url = "http://www.google.com"
@helper.tag(:a, "blah", :href => url).should =~ /href=\"#{url}\"/
end
+
+ it "renders empty tags with attributes" do
+ end
end

0 comments on commit 6c0d531

Please sign in to comment.