Skip to content
This repository
Browse code

spec for logout button helper

  • Loading branch information...
commit 1c8dccdc6ff44d0294cef08627aff8875d7fdca5 1 parent 0bd67d6
Kristian Mandrup authored
2  lib/facebook-social_plugins/view_helper.rb
@@ -46,7 +46,7 @@ def fb_login_button options = {}
46 46
47 47 def fb_logout_button options = {}
48 48 content_tag :a, '', {:id => 'fb_logout_and_reload', :href => '#'}.merge(options[:html] || {}) do
49   - content_tag :img, :id => 'fb_logout_image', :src => "/assets/fb_logout_#{options[:size] || :small}.gif", :alt => "Facebook Logout"
  49 + content_tag(:img, '', :id => 'fb_logout_image', :src => "/assets/fb_logout_#{options[:size] || :small}.gif", :alt => "Facebook Logout").html_safe
50 50 end
51 51 end
52 52
7 spec/facebook-social_plugins/view_helper_spec.rb
@@ -17,6 +17,13 @@
17 17 end
18 18 end
19 19
  20 + describe 'Logout button' do
  21 + it "should create :logout button (anchor with image" do
  22 + output = fb_logout_button :size => :large
  23 + 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>"
  24 + end
  25 + end
  26 +
20 27 describe 'Facebook Root placeholder' do
21 28 it "should create :root div" do
22 29 output = fb_root

0 comments on commit 1c8dccd

Please sign in to comment.
Something went wrong with that request. Please try again.