Permalink
Browse files

spec for logout button helper

  • Loading branch information...
1 parent 0bd67d6 commit 1c8dccdc6ff44d0294cef08627aff8875d7fdca5 @kristianmandrup committed Apr 3, 2012
Showing with 8 additions and 1 deletion.
  1. +1 −1 lib/facebook-social_plugins/view_helper.rb
  2. +7 −0 spec/facebook-social_plugins/view_helper_spec.rb
View
2 lib/facebook-social_plugins/view_helper.rb
@@ -46,7 +46,7 @@ def fb_login_button options = {}
def fb_logout_button options = {}
content_tag :a, '', {:id => 'fb_logout_and_reload', :href => '#'}.merge(options[:html] || {}) do
- content_tag :img, :id => 'fb_logout_image', :src => "/assets/fb_logout_#{options[:size] || :small}.gif", :alt => "Facebook Logout"
+ content_tag(:img, '', :id => 'fb_logout_image', :src => "/assets/fb_logout_#{options[:size] || :small}.gif", :alt => "Facebook Logout").html_safe
end
end
View
7 spec/facebook-social_plugins/view_helper_spec.rb
@@ -17,6 +17,13 @@
end
end
+ describe 'Logout button' do
+ it "should create :logout button (anchor with image" do
+ output = fb_logout_button :size => :large
+ output.should == "<a href=\"#\" id=\"fb_logout_and_reload\"><img alt=\"Facebook Logout\" id=\"fb_logout_image\" src=\"/assets/fb_logout_large.gif\"></img></a>"
+ end
+ end
+
describe 'Facebook Root placeholder' do
it "should create :root div" do
output = fb_root

0 comments on commit 1c8dccd

Please sign in to comment.