Module: Facebooker::Rails::TestHelpers

Included in:
IntegrationSession
Defined in:
lib/facebooker/rails/test_helpers.rb

Instance Method Summary collapse

Instance Method Details

#assert_facebook_redirect_to(url) ⇒ Object



4
5
6
7
8
# File 'lib/facebooker/rails/test_helpers.rb', line 4

def assert_facebook_redirect_to(url)
  assert_response :success
  assert_not_nil facebook_redirect_url
  assert_equal url, facebook_redirect_url
end

#facebook_delete(path, params = {}) ⇒ Object



26
27
28
# File 'lib/facebooker/rails/test_helpers.rb', line 26

def facebook_delete(path,params={})
  facebook_verb(:delete,path,params)
end

#facebook_get(path, params = {}) ⇒ Object



14
15
16
# File 'lib/facebooker/rails/test_helpers.rb', line 14

def facebook_get(path,params={})
  facebook_verb(:get,path,params)
end

#facebook_params(params = {}) ⇒ Object



34
35
36
37
38
# File 'lib/facebooker/rails/test_helpers.rb', line 34

def facebook_params(params = {})
  params = default_facebook_parameters.with_indifferent_access.merge(params || {})
  sig = generate_signature params
  params.merge(:fb_sig => sig)
end

#facebook_post(path, params = {}) ⇒ Object



18
19
20
# File 'lib/facebooker/rails/test_helpers.rb', line 18

def facebook_post(path,params={})
  facebook_verb(:post,path,params)
end

#facebook_put(path, params = {}) ⇒ Object



22
23
24
# File 'lib/facebooker/rails/test_helpers.rb', line 22

def facebook_put(path,params={})
  facebook_verb(:put,path,params)
end

#facebook_verb(verb, path, params = {}) ⇒ Object



30
31
32
# File 'lib/facebooker/rails/test_helpers.rb', line 30

def facebook_verb(verb,path, params={})
  send verb, path, facebook_params(params).reverse_merge(:canvas => true)
end

#follow_facebook_redirect!Object



10
11
12
# File 'lib/facebooker/rails/test_helpers.rb', line 10

def follow_facebook_redirect!
  facebook_post facebook_redirect_url
end