Bump gem version and fix current_facebook_user
This commit is contained in:
parent
6f52778c38
commit
674b45135a
@ -1,6 +1,6 @@
|
|||||||
spec = Gem::Specification.new do |s|
|
spec = Gem::Specification.new do |s|
|
||||||
s.name = 'facebooker2'
|
s.name = 'facebooker2'
|
||||||
s.version = '0.0.1'
|
s.version = '0.0.2'
|
||||||
s.summary = "Facebook Connect integration library for ruby and rails"
|
s.summary = "Facebook Connect integration library for ruby and rails"
|
||||||
s.description = "Facebook Connect integration library for ruby and rails"
|
s.description = "Facebook Connect integration library for ruby and rails"
|
||||||
s.files = Dir['lib/**/*.rb']
|
s.files = Dir['lib/**/*.rb']
|
||||||
|
@ -34,6 +34,7 @@ module Facebooker2
|
|||||||
end
|
end
|
||||||
|
|
||||||
def fb_sign_in_user_and_client(user,client)
|
def fb_sign_in_user_and_client(user,client)
|
||||||
|
user.client = client
|
||||||
@_current_facebook_user = user
|
@_current_facebook_user = user
|
||||||
@_current_facebook_client = client
|
@_current_facebook_client = client
|
||||||
@_fb_user_fetched = true
|
@_fb_user_fetched = true
|
||||||
|
@ -2,7 +2,7 @@ module Facebooker2
|
|||||||
module Rails
|
module Rails
|
||||||
module Helpers
|
module Helpers
|
||||||
module Javascript
|
module Javascript
|
||||||
def fb_connect_async_js(app_id,options={})
|
def fb_connect_async_js(app_id=Facebooker2.app_id,options={})
|
||||||
opts = Hash.new(true).merge!(options)
|
opts = Hash.new(true).merge!(options)
|
||||||
cookie = opts[:cookie]
|
cookie = opts[:cookie]
|
||||||
status = opts[:status]
|
status = opts[:status]
|
||||||
|
@ -11,6 +11,11 @@ describe Facebooker2::Rails::Helpers::FacebookConnect, :type=>:helper do
|
|||||||
fb_login_and_redirect("/",:text=>"my test").should ==
|
fb_login_and_redirect("/",:text=>"my test").should ==
|
||||||
"<fb:login-button onlogin=\"window.location.href = "/";\">my test</fb:login-button>"
|
"<fb:login-button onlogin=\"window.location.href = "/";\">my test</fb:login-button>"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "allows you to specify the permissions" do
|
||||||
|
fb_login_and_redirect("/",:perms=>"email,offline_access").should ==
|
||||||
|
"<fb:login-button onlogin=\"window.location.href = "/";\" perms=\"email,offline_access\"></fb:login-button>"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "Logging out" do
|
describe "Logging out" do
|
||||||
|
@ -42,6 +42,10 @@ describe Facebooker2::Rails::Controller do
|
|||||||
controller.current_facebook_user.id.should == "12451752"
|
controller.current_facebook_user.id.should == "12451752"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "sets the client for the user" do
|
||||||
|
controller.current_facebook_user.client.access_token.should == "114355055262088|57f0206b01ad48bf84ac86f1-12451752|63WyZjRQbzowpN8ibdIfrsg80OA."
|
||||||
|
end
|
||||||
|
|
||||||
it "doesn't create a user if there is no app cookie" do
|
it "doesn't create a user if there is no app cookie" do
|
||||||
Facebooker2.app_id="other_app"
|
Facebooker2.app_id="other_app"
|
||||||
controller.current_facebook_user.should be_nil
|
controller.current_facebook_user.should be_nil
|
||||||
@ -87,7 +91,7 @@ describe Facebooker2::Rails::Controller do
|
|||||||
controller.fb_sign_in_user_and_client(Mogli::User.new,Mogli::Client.new)
|
controller.fb_sign_in_user_and_client(Mogli::User.new,Mogli::Client.new)
|
||||||
end
|
end
|
||||||
it "has a current_facebook_user" do
|
it "has a current_facebook_user" do
|
||||||
user = mock("user")
|
user = mock("user",:client= => nil)
|
||||||
controller.fb_sign_in_user_and_client(user,Mogli::Client.new)
|
controller.fb_sign_in_user_and_client(user,Mogli::Client.new)
|
||||||
controller.current_facebook_user.should == user
|
controller.current_facebook_user.should == user
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user