Codebase list ruby-omniauth-facebook / 8f6c1b1e-22ef-407c-97f7-02d0cfc2023b/upstream
Import upstream version 9.0.0 Debian Janitor 1 year, 5 months ago
14 changed file(s) with 211 addition(s) and 97 deletion(s). Raw diff Collapse all Expand all
0 name: Ruby
1
2 on: [push, pull_request]
3
4 jobs:
5 test:
6 runs-on: ${{ matrix.os }}-latest
7 strategy:
8 fail-fast: false
9 matrix:
10 os:
11 - ubuntu
12 ruby:
13 - "2.5"
14 - "2.6"
15 - "2.7"
16 - "3.0"
17 steps:
18 - uses: actions/checkout@v2
19 - name: Set up Ruby
20 uses: ruby/setup-ruby@v1
21 with:
22 ruby-version: ${{ matrix.ruby }}
23 bundler-cache: true
24 - name: Install dependencies
25 run: bundle install
26 - name: Run tests
27 run: bundle exec rake
0 name: Mark stale issues and pull requests
1
2 on:
3 schedule:
4 - cron: "0 0 * * *"
5
6 jobs:
7 stale:
8
9 runs-on: ubuntu-latest
10
11 steps:
12 - uses: actions/stale@v1
13 with:
14 repo-token: ${{ secrets.GITHUB_TOKEN }}
15 stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.'
16 stale-pr-message: 'This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.'
17 stale-issue-label: 'no-issue-activity'
18 stale-pr-label: 'no-pr-activity'
19 days-before-stale: 30
20 days-before-close: 5
21 exempt-pr-label: 'pinned'
22 exempt-issue-label: 'pinned'
+0
-13
.travis.yml less more
0 before_install:
1 - gem update bundler
2 - bundle --version
3 - gem update --system
4 - gem --version
5 rvm:
6 - 2.3.0
7 - 2.2
8 - 2.1
9 - 2.0
10 - 1.9.3
11 - jruby-19mode
12 - rbx-2
0 ## 9.0.0 (2021-10-25)
1
2 Changes:
3
4 - bumped version of FB Graph API to v5.0
5
6 ## 8.0.0 (2020-10-20)
7
8 Changes:
9
10 - user profile picture link includes access token (#344, @anklos)
11
12 ## 7.0.0 (2020-08-03)
13
14 Changes:
15
16 - bumped version of FB Graph API to v4.0
17
18 ## 6.0.0 (2020-01-27)
19
20 Changes:
21
22 - bumped version of FB Graph API to v3.0
23
24 ## 5.0.0 (2018-03-29)
25
26 Changes:
27
28 - bumped version of FB Graph API to v2.10 (#297, @piotrjaworski)
29 - use only CRuby 2.0+ on CI (#298, @simi)
30
031 ## 4.0.0 (2016-07-26)
132
233 Changes:
536 - switch to versioned FB APIs, currently using v2.6 (#245, @printercu, @mkdynamic)
637 - remove deprecated :nickname field from README example (#223, @abelorian)
738 - add Ruby 2.2 + 2.3.0 to CI (#225, @tricknotes, @mkdynamic, @anoraak)
8 - update example app (@mkynamic)
39 - update example app (@mkdynamic)
940
1041 ## 3.0.0 (2015-10-26)
1142
11
22 gemspec
33
4 platforms :rbx do
5 gem 'rubysl', '~> 2.0'
6 end
4 gem 'rack', '>= 2.0'
0 # OmniAuth Facebook  [![Build Status](https://secure.travis-ci.org/mkdynamic/omniauth-facebook.svg?branch=master)](https://travis-ci.org/mkdynamic/omniauth-facebook) [![Gem Version](https://img.shields.io/gem/v/omniauth-facebook.svg)](https://rubygems.org/gems/omniauth-facebook)
0 # OmniAuth Facebook  [![Build Status](https://secure.travis-ci.org/simi/omniauth-facebook.svg?branch=master)](https://travis-ci.org/simi/omniauth-facebook) [![Gem Version](https://img.shields.io/gem/v/omniauth-facebook.svg)](https://rubygems.org/gems/omniauth-facebook)
1
2 📣 **NOTICE** We’re looking for maintainers to help keep this project up-to-date. If you are interested in helping please open an Issue expressing your interest. Thanks! 📣
13
24 **These notes are based on master, please see tags for README pertaining to specific releases.**
35
2325
2426 ```ruby
2527 Rails.application.config.middleware.use OmniAuth::Builder do
26 provider :facebook, ENV['FACEBOOK_KEY'], ENV['FACEBOOK_SECRET']
28 provider :facebook, ENV['FACEBOOK_APP_ID'], ENV['FACEBOOK_APP_SECRET']
2729 end
2830 ```
2931
30 [See the example Sinatra app for full examples](https://github.com/mkdynamic/omniauth-facebook/blob/master/example/config.ru) of both the server and client-side flows (including using the Facebook Javascript SDK).
32 [See the example Sinatra app for full examples](https://github.com/simi/omniauth-facebook/blob/master/example/config.ru) of both the server and client-side flows (including using the Facebook Javascript SDK).
3133
3234 ## Configuring
3335
3840 `scope` | `email` | A comma-separated list of permissions you want to request from the user. See the Facebook docs for a full list of available permissions: https://developers.facebook.com/docs/reference/login/
3941 `display` | `page` | The display context to show the authentication page. Options are: `page`, `popup` and `touch`. Read the Facebook docs for more details: https://developers.facebook.com/docs/reference/dialogs/oauth/
4042 `image_size` | `square` | Set the size for the returned image url in the auth hash. Valid options include `square` (50x50), `small` (50 pixels wide, variable height), `normal` (100 pixels wide, variable height), or `large` (about 200 pixels wide, variable height). Additionally, you can request a picture of a specific size by setting this option to a hash with `:width` and `:height` as keys. This will return an available profile picture closest to the requested size and requested aspect ratio. If only `:width` or `:height` is specified, we will return a picture whose width or height is closest to the requested size, respectively.
41 `info_fields` | 'name,email' | Specify exactly which fields should be returned when getting the user's info. Value should be a comma-separated string as per https://developers.facebook.com/docs/graph-api/reference/user/ (only `/me` endpoint).
43 `info_fields` | `name,email` | Specify exactly which fields should be returned when getting the user's info. Value should be a comma-separated string as per https://developers.facebook.com/docs/graph-api/reference/user/ (only `/me` endpoint).
4244 `locale` | | Specify locale which should be used when getting the user's info. Value should be locale string as per https://developers.facebook.com/docs/reference/api/locale/.
4345 `auth_type` | | Optionally specifies the requested authentication features as a comma-separated list, as per https://developers.facebook.com/docs/facebook-login/reauthentication/. Valid values are `https` (checks for the presence of the secure cookie and asks for re-authentication if it is not present), and `reauthenticate` (asks the user to re-authenticate unconditionally). Use 'rerequest' when you want to request premissions. Default is `nil`.
44 `secure_image_url` | `false` | Set to `true` to use https for the avatar image url returned in the auth hash.
46 `secure_image_url` | `true` | Set to `true` to use https for the avatar image url returned in the auth hash. SSL is mandatory as per https://developers.facebook.com/docs/facebook-login/security#surfacearea.
4547 `callback_url` / `callback_path` | | Specify a custom callback URL used during the server-side flow. Note this must be allowed by your app configuration on Facebook (see 'Valid OAuth redirect URIs' under the 'Advanced' settings section in the configuration for your Facebook app for more details).
4648
4749 For example, to request `email`, `user_birthday` and `read_stream` permissions and display the authentication page in a popup window:
4850
4951 ```ruby
5052 Rails.application.config.middleware.use OmniAuth::Builder do
51 provider :facebook, ENV['APP_ID'], ENV['APP_SECRET'],
53 provider :facebook, ENV['FACEBOOK_APP_ID'], ENV['FACEBOOK_APP_SECRET'],
5254 scope: 'email,user_birthday,read_stream', display: 'popup'
5355 end
5456 ```
5557
5658 ### API Version
5759
58 OmniAuth Facebook uses versioned API endpoints by default (current v2.6). You can configure a different version via `client_options` hash passed to `provider`, specifically you should change the version in the `site` and `authorize_url` parameters. For example, to change to v3.0 (assuming that exists):
60 OmniAuth Facebook uses versioned API endpoints by default (current v5.0). You can configure a different version via `client_options` hash passed to `provider`, specifically you should change the version in the `site` and `authorize_url` parameters. For example, to change to v7.0 (assuming that exists):
5961
6062 ```ruby
6163 use OmniAuth::Builder do
62 provider :facebook, ENV['APP_ID'], ENV['APP_SECRET'],
64 provider :facebook, ENV['FACEBOOK_APP_ID'], ENV['FACEBOOK_APP_SECRET'],
6365 client_options: {
64 site: 'https://graph.facebook.com/v3.0',
65 authorize_url: "https://www.facebook.com/v3.0/dialog/oauth"
66 site: 'https://graph.facebook.com/v7.0',
67 authorize_url: "https://www.facebook.com/v7.0/dialog/oauth"
6668 }
6769 end
6870 ```
8486 name: 'Joe Bloggs',
8587 first_name: 'Joe',
8688 last_name: 'Bloggs',
87 image: 'http://graph.facebook.com/1234567/picture?type=square',
88 urls: { Facebook: 'http://www.facebook.com/jbloggs' },
89 location: 'Palo Alto, California',
89 image: 'http://graph.facebook.com/1234567/picture?type=square&access_token=...',
9090 verified: true
9191 },
9292 credentials: {
151151
152152 ## Supported Rubies
153153
154 - Ruby MRI (1.9.3+)
155 - JRuby (1.9 mode)
156 - RBX (2.1.1+)
154 - Ruby MRI (2.5, 2.6, 2.7, 3.0)
157155
158156 ## License
159157
00 PATH
1 remote: ../
1 remote: ..
22 specs:
3 omniauth-facebook (3.0.0)
3 omniauth-facebook (8.0.0)
44 omniauth-oauth2 (~> 1.2)
55
66 GEM
77 remote: https://rubygems.org/
88 specs:
9 backports (3.6.8)
10 faraday (0.9.2)
9 backports (3.15.0)
10 faraday (1.1.0)
1111 multipart-post (>= 1.2, < 3)
12 hashie (3.4.4)
13 jwt (1.5.1)
14 multi_json (1.12.1)
15 multi_xml (0.5.5)
16 multipart-post (2.0.0)
17 oauth2 (1.1.0)
18 faraday (>= 0.8, < 0.10)
19 jwt (~> 1.0, < 1.5.2)
12 ruby2_keywords
13 hashie (4.1.0)
14 jwt (2.2.2)
15 multi_json (1.14.1)
16 multi_xml (0.6.0)
17 multipart-post (2.1.1)
18 mustermann (1.1.1)
19 ruby2_keywords (~> 0.0.1)
20 oauth2 (1.4.4)
21 faraday (>= 0.8, < 2.0)
22 jwt (>= 1.0, < 3.0)
2023 multi_json (~> 1.3)
2124 multi_xml (~> 0.5)
2225 rack (>= 1.2, < 3)
23 omniauth (1.3.1)
24 hashie (>= 1.2, < 4)
25 rack (>= 1.0, < 3)
26 omniauth-oauth2 (1.4.0)
27 oauth2 (~> 1.0)
28 omniauth (~> 1.2)
29 rack (1.6.4)
30 rack-protection (1.5.3)
26 omniauth (1.9.1)
27 hashie (>= 3.4.6)
28 rack (>= 1.6.2, < 3)
29 omniauth-oauth2 (1.7.0)
30 oauth2 (~> 1.4)
31 omniauth (~> 1.9)
32 rack (2.2.3)
33 rack-protection (2.0.8.1)
3134 rack
32 rack-test (0.6.3)
33 rack (>= 1.0)
34 sinatra (1.4.7)
35 rack (~> 1.5)
36 rack-protection (~> 1.4)
37 tilt (>= 1.3, < 3)
38 sinatra-contrib (1.4.7)
39 backports (>= 2.0)
35 ruby2_keywords (0.0.2)
36 sinatra (2.0.8.1)
37 mustermann (~> 1.0)
38 rack (~> 2.0)
39 rack-protection (= 2.0.8.1)
40 tilt (~> 2.0)
41 sinatra-contrib (2.0.8.1)
42 backports (>= 2.8.2)
4043 multi_json
41 rack-protection
42 rack-test
43 sinatra (~> 1.4.0)
44 tilt (>= 1.3, < 3)
44 mustermann (~> 1.0)
45 rack-protection (= 2.0.8.1)
46 sinatra (= 2.0.8.1)
47 tilt (~> 2.0)
4548 sinatra-reloader (1.0)
4649 sinatra-contrib
47 tilt (2.0.5)
50 tilt (2.0.10)
4851
4952 PLATFORMS
5053 ruby
54 x64-mingw32
5155
5256 DEPENDENCIES
5357 omniauth-facebook!
5559 sinatra-reloader
5660
5761 BUNDLED WITH
58 1.12.5
62 1.17.3
00 require 'sinatra'
11 require "sinatra/reloader"
22 require 'yaml'
3 require 'json'
34
45 # configure sinatra
56 set :run, false
2627 <script type="text/javascript">
2728 window.fbAsyncInit = function() {
2829 FB.init({
29 appId: '#{ENV['APP_ID']}',
30 version: 'v2.6',
30 appId: '#{ENV['FACEBOOK_APP_ID']}',
31 version: 'v4.0',
3132 cookie: true // IMPORTANT must enable cookies to allow the server to access the session
3233 });
3334 console.log("fb init");
8081 # - ajax request made here for client-side flow
8182 get '/auth/:provider/callback' do
8283 content_type 'application/json'
83 MultiJson.encode(request.env)
84 JSON.dump(request.env)
8485 end
44 use Rack::Session::Cookie, secret: 'abc123'
55
66 use OmniAuth::Builder do
7 provider :facebook, ENV['APP_ID'], ENV['APP_SECRET']
7 provider :facebook, ENV['FACEBOOK_APP_ID'], ENV['FACEBOOK_APP_SECRET']
88 end
99
1010 run Sinatra::Application
00 module OmniAuth
11 module Facebook
2 VERSION = "4.0.0"
2 VERSION = '9.0.0'
33 end
44 end
99 class NoAuthorizationCodeError < StandardError; end
1010
1111 DEFAULT_SCOPE = 'email'
12 DEFAULT_FACEBOOK_API_VERSION = 'v5.0'.freeze
1213
1314 option :client_options, {
14 site: 'https://graph.facebook.com/v2.6',
15 authorize_url: "https://www.facebook.com/v2.6/dialog/oauth",
15 site: "https://graph.facebook.com/#{DEFAULT_FACEBOOK_API_VERSION}",
16 authorize_url: "https://www.facebook.com/#{DEFAULT_FACEBOOK_API_VERSION}/dialog/oauth",
1617 token_url: 'oauth/access_token'
1718 }
1819
2122 param_name: 'access_token'
2223 }
2324
25 option :authorization_code_from_signed_request_in_cookie, nil
26
2427 option :authorize_options, [:scope, :display, :auth_type]
28
29 option :secure_image_url, true
2530
2631 uid { raw_info['id'] }
2732
7580 # phase and it must match during the access_token phase:
7681 # https://github.com/facebook/facebook-php-sdk/blob/master/src/base_facebook.php#L477
7782 def callback_url
78 if @authorization_code_from_signed_request_in_cookie
83 if options.authorization_code_from_signed_request_in_cookie
7984 ''
8085 else
8186 # Fixes regression in omniauth-oauth2 v1.4.0 by https://github.com/intridea/omniauth-oauth2/commit/85fdbe117c2a4400d001a6368cc359d88f40abc7
130135 yield
131136 elsif code_from_signed_request = signed_request_from_cookie && signed_request_from_cookie['code']
132137 request.params['code'] = code_from_signed_request
133 @authorization_code_from_signed_request_in_cookie = true
138 options.authorization_code_from_signed_request_in_cookie = true
134139 # NOTE The code from the signed fbsr_XXX cookie is set by the FB JS SDK will confirm that the identity of the
135140 # user contained in the signed request matches the user loading the app.
136141 original_provider_ignores_state = options.provider_ignores_state
139144 yield
140145 ensure
141146 request.params.delete('code')
142 @authorization_code_from_signed_request_in_cookie = false
147 options.authorization_code_from_signed_request_in_cookie = false
143148 options.provider_ignores_state = original_provider_ignores_state
144149 end
145150 else
158163 uri_class = options[:secure_image_url] ? URI::HTTPS : URI::HTTP
159164 site_uri = URI.parse(client.site)
160165 url = uri_class.build({host: site_uri.host, path: "#{site_uri.path}/#{uid}/picture"})
166 query = { access_token: access_token.token }
161167
162 query = if options[:image_size].is_a?(String) || options[:image_size].is_a?(Symbol)
163 { type: options[:image_size] }
168 if options[:image_size].is_a?(String) || options[:image_size].is_a?(Symbol)
169 query[:type] = options[:image_size]
164170 elsif options[:image_size].is_a?(Hash)
165 options[:image_size]
171 query.merge!(options[:image_size])
166172 end
167 url.query = Rack::Utils.build_query(query) if query
173
174 url.query = Rack::Utils.build_query(query)
168175
169176 url.to_s
170177 end
77 s.authors = ['Mark Dodwell', 'Josef Šimánek']
88 s.email = ['mark@madeofcode.com', 'retro@ballgag.cz']
99 s.summary = 'Facebook OAuth2 Strategy for OmniAuth'
10 s.homepage = 'https://github.com/mkdynamic/omniauth-facebook'
10 s.homepage = 'https://github.com/simi/omniauth-facebook'
1111 s.license = 'MIT'
1212
1313 s.files = `git ls-files`.split("\n")
4040
4141 @client_id = '123'
4242 @client_secret = '53cr3tz'
43 @options = {}
44
45 @facebook_api_version = OmniAuth::Strategies::Facebook::DEFAULT_FACEBOOK_API_VERSION
4346 end
4447
4548 def strategy
5255 end
5356 end
5457
55 Dir[File.expand_path('../support/**/*', __FILE__)].each &method(:require)
58 Dir[File.expand_path('../support/**/*', __FILE__)].each(&method(:require))
88
99 class ClientTest < StrategyTestCase
1010 test 'has correct Facebook site' do
11 assert_equal 'https://graph.facebook.com/v2.6', strategy.client.site
11 assert_equal "https://graph.facebook.com/#{@facebook_api_version}", strategy.client.site
1212 end
1313
1414 test 'has correct authorize url' do
15 assert_equal 'https://www.facebook.com/v2.6/dialog/oauth', strategy.client.options[:authorize_url]
15 assert_equal "https://www.facebook.com/#{@facebook_api_version}/dialog/oauth", strategy.client.options[:authorize_url]
1616 end
1717
1818 test 'has correct token url with versioning' do
9494 end
9595
9696 class InfoTest < StrategyTestCase
97 test 'returns the secure facebook avatar url when `secure_image_url` option is specified' do
97 def setup
98 super
99 @access_token = stub('OAuth2::AccessToken')
100 @access_token.stubs(:token).returns('test_access_token')
101 end
102
103 test 'returns the secure facebook avatar url when `secure_image_url` option is set to true' do
98104 @options = { secure_image_url: true }
99105 raw_info = { 'name' => 'Fred Smith', 'id' => '321' }
100106 strategy.stubs(:raw_info).returns(raw_info)
101 assert_equal 'https://graph.facebook.com/v2.6/321/picture', strategy.info['image']
107 strategy.stubs(:access_token).returns(@access_token)
108 assert_equal "https://graph.facebook.com/#{@facebook_api_version}/321/picture?access_token=test_access_token", strategy.info['image']
109 end
110
111 test 'returns the non-ssl facebook avatar url when `secure_image_url` option is set to false' do
112 @options = { secure_image_url: false }
113 raw_info = { 'name' => 'Fred Smith', 'id' => '321' }
114 strategy.stubs(:raw_info).returns(raw_info)
115 strategy.stubs(:access_token).returns(@access_token)
116 assert_equal "http://graph.facebook.com/#{@facebook_api_version}/321/picture?access_token=test_access_token", strategy.info['image']
117 end
118
119 test 'returns the secure facebook avatar url when `secure_image_url` option is omitted' do
120 raw_info = { 'name' => 'Fred Smith', 'id' => '321' }
121 strategy.stubs(:raw_info).returns(raw_info)
122 strategy.stubs(:access_token).returns(@access_token)
123 assert_equal "https://graph.facebook.com/#{@facebook_api_version}/321/picture?access_token=test_access_token", strategy.info['image']
102124 end
103125
104126 test 'returns the image_url based of the client site' do
105127 @options = { secure_image_url: true, client_options: {site: "https://blah.facebook.com/v2.2"}}
106128 raw_info = { 'name' => 'Fred Smith', 'id' => '321' }
107129 strategy.stubs(:raw_info).returns(raw_info)
108 assert_equal 'https://blah.facebook.com/v2.2/321/picture', strategy.info['image']
130 strategy.stubs(:access_token).returns(@access_token)
131 assert_equal "https://blah.facebook.com/v2.2/321/picture?access_token=test_access_token", strategy.info['image']
109132 end
110133
111134 test 'returns the image with size specified in the `image_size` option' do
112135 @options = { image_size: 'normal' }
113136 raw_info = { 'name' => 'Fred Smith', 'id' => '321' }
114137 strategy.stubs(:raw_info).returns(raw_info)
115 assert_equal 'http://graph.facebook.com/v2.6/321/picture?type=normal', strategy.info['image']
138 strategy.stubs(:access_token).returns(@access_token)
139 assert_equal "https://graph.facebook.com/#{@facebook_api_version}/321/picture?access_token=test_access_token&type=normal", strategy.info['image']
116140 end
117141
118142 test 'returns the image with size specified as a symbol in the `image_size` option' do
119143 @options = { image_size: :normal }
120144 raw_info = { 'name' => 'Fred Smith', 'id' => '321' }
121145 strategy.stubs(:raw_info).returns(raw_info)
122 assert_equal 'http://graph.facebook.com/v2.6/321/picture?type=normal', strategy.info['image']
146 strategy.stubs(:access_token).returns(@access_token)
147 assert_equal "https://graph.facebook.com/#{@facebook_api_version}/321/picture?access_token=test_access_token&type=normal", strategy.info['image']
123148 end
124149
125150 test 'returns the image with width and height specified in the `image_size` option' do
126151 @options = { image_size: { width: 123, height: 987 } }
127152 raw_info = { 'name' => 'Fred Smith', 'id' => '321' }
128153 strategy.stubs(:raw_info).returns(raw_info)
154 strategy.stubs(:access_token).returns(@access_token)
129155 assert_match 'width=123', strategy.info['image']
130156 assert_match 'height=987', strategy.info['image']
131 assert_match 'http://graph.facebook.com/v2.6/321/picture?', strategy.info['image']
157 assert_match "https://graph.facebook.com/#{@facebook_api_version}/321/picture?access_token=test_access_token", strategy.info['image']
132158 end
133159 end
134160
137163 super
138164 @raw_info ||= { 'name' => 'Fred Smith' }
139165 strategy.stubs(:raw_info).returns(@raw_info)
166
167 access_token = stub('OAuth2::AccessToken')
168 access_token.stubs(:token).returns('test_access_token')
169 strategy.stubs(:access_token).returns(access_token)
140170 end
141171
142172 test 'returns the name' do
175205
176206 test 'returns the facebook avatar url' do
177207 @raw_info['id'] = '321'
178 assert_equal 'http://graph.facebook.com/v2.6/321/picture', strategy.info['image']
208 assert_equal "https://graph.facebook.com/#{@facebook_api_version}/321/picture?access_token=test_access_token", strategy.info['image']
179209 end
180210
181211 test 'returns the Facebook link as the Facebook url' do
214244 super
215245 @raw_info ||= { 'name' => 'Fred Smith' }
216246 strategy.stubs(:raw_info).returns(@raw_info)
247
248 access_token = stub('OAuth2::AccessToken')
249 access_token.stubs(:token).returns('test_access_token')
250 strategy.stubs(:access_token).returns(access_token)
217251 end
218252
219253 test 'has no email key' do
257291 @options = {appsecret_proof: @appsecret_proof, fields: 'name,email'}
258292 end
259293
260 test 'performs a GET to https://graph.facebook.com/v2.6/me' do
294 test "performs a GET to https://graph.facebook.com/#{@facebook_api_version}/me" do
261295 strategy.stubs(:appsecret_proof).returns(@appsecret_proof)
262296 strategy.stubs(:access_token).returns(@access_token)
263297 params = {params: @options}
265299 strategy.raw_info
266300 end
267301
268 test 'performs a GET to https://graph.facebook.com/v2.6/me with locale' do
302 test "performs a GET to https://graph.facebook.com/#{@facebook_api_version}/me with locale" do
269303 @options.merge!({ locale: 'cs_CZ' })
270304 strategy.stubs(:access_token).returns(@access_token)
271305 strategy.stubs(:appsecret_proof).returns(@appsecret_proof)
274308 strategy.raw_info
275309 end
276310
277 test 'performs a GET to https://graph.facebook.com/v2.6/me with info_fields' do
311 test "performs a GET to https://graph.facebook.com/#{@facebook_api_version}/me with info_fields" do
278312 @options.merge!({info_fields: 'about'})
279313 strategy.stubs(:access_token).returns(@access_token)
280314 strategy.stubs(:appsecret_proof).returns(@appsecret_proof)
283317 strategy.raw_info
284318 end
285319
286 test 'performs a GET to https://graph.facebook.com/v2.6/me with default info_fields' do
320 test "performs a GET to https://graph.facebook.com/#{@facebook_api_version}/me with default info_fields" do
287321 strategy.stubs(:access_token).returns(@access_token)
288322 strategy.stubs(:appsecret_proof).returns(@appsecret_proof)
289323 params = {params: {appsecret_proof: @appsecret_proof, fields: 'name,email'}}
451485 end
452486
453487 test 'empty param' do
454 assert_equal nil, strategy.send(:signed_request_from_cookie)
488 assert_nil strategy.send(:signed_request_from_cookie)
455489 end
456490 end
457491