Sha256: 11142a25bd8d0052d16d0f162d41bc6d0e3105f61712f353b0d4341f4ac63064

Contents?: true

Size: 1.5 KB

Versions: 1

Compression:

Stored size: 1.5 KB

Contents

require 'test_helper'

class NanocFuel::Helpers::FacebookTest < MiniTest::Unit::TestCase
  include NanocFuel::Helpers::Facebook

  def test_fb_init
    
    html = %q{
<script type='text/javascript'>
  //<![CDATA[
    window.fbAsyncInit = function() {
      FB.init({appId: '12345', status: true, cookie: true, xfbml: true});
      fbInitHook();
      FB.Canvas.setSize();
    };

    function fbInitHook() {}

    function sizeChangeCallback() {
      FB.Canvas.setSize();
    }

    (function() {
      var e = document.createElement('script'); e.async = true;
      e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
      document.getElementById('fb-root').appendChild(e);
    }());
  //]]>
</script>
    }
    assert_equal compact(html), compact(fb_init('12345'))
  end
  
  def test_fb_comments
    html = %q{
      <fb:comments href='http://example.com' num_posts='10' width='520'></fb:comments>
    }
    assert_equal compact(html), compact(fb_comments('http://example.com', '10', '520'))
  end
  
  def test_fb_like_btn
    html = %q{
      <iframe allowTransparency='true' frameborder='0' scrolling='no' src='http://www.facebook.com/plugins/like.php?href&amp;amp;send=true&amp;amp;layout=standard&amp;amp;width=450&amp;amp;show_faces=true&amp;amp;action=like&amp;amp;colorscheme=light&amp;amp;font&amp;amp;height=80' style='border:none; overflow:hidden; width:450px; height:80px;'></iframe>
    }
    assert_equal compact(html), compact(fb_like_btn("standard", "450", "true", "true"))
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nanoc_fuel-0.0.2 test/helpers/facebook_test.rb