require 'test_helper' class FacebookJsHelperTest < ActionView::TestCase def setup FacebookJs.app_id = '12345' FacebookJs.domain = 'localhost:3000' end def teardown FacebookJs.status = true FacebookJs.cookie = true FacebookJs.xfbml = true FacebookJs.locale = 'en_US' FacebookJs.debug = false end test 'facebook_js should render the proper default content' do assert_equal "", facebook_js.split(/\n/).join("").delete(" ") end test 'facebook_js should render the proper content with proper status' do FacebookJs.status = false assert_equal "", facebook_js.split(/\n/).join("").delete(" ") end test 'facebook_js should render the proper content with proper cookie' do FacebookJs.cookie = false assert_equal "", facebook_js.split(/\n/).join("").delete(" ") end test 'facebook_js should render the proper content with proper xfbml' do FacebookJs.xfbml = false assert_equal "", facebook_js.split(/\n/).join("").delete(" ") end test 'facebook_js should render the proper content with proper debug' do FacebookJs.debug = true assert_equal "", facebook_js.split(/\n/).join("").delete(" ") end test 'facebook_js should render the proper content with proper locale' do FacebookJs.locale = 'zh_CN' assert_equal "", facebook_js.split(/\n/).join("").delete(" ") end test 'facebook_js should render the proper content with block' do assert_equal "", (facebook_js { 'function(){}' } ).split(/\n/).join("").delete(" ") end end