Module: FbRails::TestHelper
- Defined in:
- lib/fb_rails/test_helper.rb
Instance Method Summary collapse
-
#fb_cookie(uid = 42, access_token = 'abc') ⇒ Object
Creates a hash representation of the facebook cookie.
Instance Method Details
#fb_cookie(uid = 42, access_token = 'abc') ⇒ Object
Creates a hash representation of the facebook cookie. To use this in tests, you might do the following:
class MyControllerTest < ActionController::TestCase
test 'request that requires authentication' do
@request..merge!
get :protected_action
end
end
13 14 15 16 |
# File 'lib/fb_rails/test_helper.rb', line 13 def (uid = 42, access_token = 'abc') value = FbRails::Cookie.encode({uid: uid, access_token: access_token}, FbRails::Config.secret) {FbRails::Connect. => value} end |