0
@@ -14,7 +14,13 @@ describe "PrettyButtons" do
0
pretty_button("Label", {:icon_path => "icons/icon.gif"})
0
+ it "should create button marked up for pretty button css without icon" do
0
+ self.expects(:content_tag).with(:button, " Label", {:type => 'submit', :class => "button "})
0
+ pretty_button("Label")
0
it "should create button marked up for positive pretty button css" do
0
img_tag = "<img src='icons/tick.gif' />"
0
self.expects(:image_tag).with('icons/tick.gif').returns(img_tag)
0
@@ -23,6 +29,14 @@ describe "PrettyButtons" do
0
pretty_positive_button("Label")
0
+ it "should create button marked up for positive pretty button css" do
0
+ img_tag = "<img src='icons/another.gif' />"
0
+ self.expects(:image_tag).with('icons/another.gif').returns(img_tag)
0
+ self.expects(:content_tag).with(:button, "#{img_tag} Label", {:type => 'submit', :class => "button positive"})
0
+ pretty_positive_button("Label", {:icon_path => 'icons/another.gif'})
0
it "should create button marked up for negative pretty button css" do
0
img_tag = "<img src='icons/cross.gif' />"
0
self.expects(:image_tag).with('icons/cross.gif').returns(img_tag)
0
@@ -43,6 +57,12 @@ describe "PrettyButtons" do
0
pretty_button_link("Label", "#", {:icon_path => "icons/icon.gif"})
0
+ it "should create link marked up for pretty button css without icon" do
0
+ self.expects(:link_to).with(" Label", "#", {:class => "button "})
0
+ pretty_button_link("Label", "#")
0
it "should create link marked up for positive pretty button css" do
0
img_tag = "<img src='icons/tick.gif' />"
0
self.expects(:image_tag).with('icons/tick.gif').returns(img_tag)
0
@@ -50,7 +70,15 @@ describe "PrettyButtons" do
0
pretty_positive_button_link("Label", "#")
0
+ it "should create link marked up for positive pretty button css with alternate icon" do
0
+ img_tag = "<img src='icons/another.gif' />"
0
+ self.expects(:image_tag).with('icons/another.gif').returns(img_tag)
0
+ self.expects(:link_to).with("#{img_tag} Label", "#", {:class => "button positive"})
0
+ pretty_positive_button_link("Label", "#", {:icon_path => 'icons/another.gif'})
0
it "should create link marked up for negative pretty button css" do
0
img_tag = "<img src='icons/cross.gif' />"
0
self.expects(:image_tag).with('icons/cross.gif').returns(img_tag)
Comments
No one has commented yet.