Permalink
Browse files

oauth property for javascript now controlled by yml

  • Loading branch information...
1 parent 2532534 commit 7c7f3569a38d9ea3f65ef2181cec6c5f45a060be andy committed Aug 16, 2011
Showing with 6 additions and 3 deletions.
  1. +2 −1 .gitignore
  2. +1 −1 lib/facebooker2/rails/helpers/javascript.rb
  3. +3 −1 spec/helpers/javascript_spec.rb
View
@@ -1,4 +1,5 @@
*.swp
.bundle
.rvmrc
-Gemfile.lock
+Gemfile.lock
+.idea
@@ -16,7 +16,7 @@ def fb_connect_async_js(app_id=Facebooker2.app_id,options={},&proc)
cookie = opts[:cookie].nil? ? true : opts[:cookie]
status = opts[:status].nil? ? true : opts[:status]
xfbml = opts[:xfbml].nil? ? true : opts[:xfbml]
- oauth2 = opts[:oauth2].nil? ? false : true
+ oauth2 = Facebooker2.oauth2 ? true : false
channel_url = opts[:channel_url]
lang = opts[:locale] || 'en_US'
extra_js = capture(&proc) if block_given?
@@ -1,6 +1,7 @@
require "spec_helper"
describe Facebooker2::Rails::Helpers::Javascript, :type=>:helper do
include Facebooker2::Rails::Helpers
+ include Facebooker2
describe "fb_connect_async_js" do
it "loads with defaults" do
pending
@@ -54,7 +55,8 @@
end
it "supports oauth" do
- js = fb_connect_async_js '12345', :oauth2=> true
+ Facebooker2.oauth2=true
+ js = fb_connect_async_js '12345'
js.include?("oauth").should be_true, js
end

0 comments on commit 7c7f356

Please sign in to comment.