omniauth-meetup 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,7 +21,10 @@ module OmniAuth
|
|
21
21
|
{
|
22
22
|
:id => raw_info['id'],
|
23
23
|
:name => raw_info['name'],
|
24
|
-
:photo_url => (raw_info
|
24
|
+
:photo_url => (raw_info.key?('photo') ? raw_info['photo']['photo_link'] : nil),
|
25
|
+
:urls => { :public_profile => raw_info['link'] },
|
26
|
+
:description => raw_info['bio'],
|
27
|
+
:location => [raw_info['city'], raw_info['state'], raw_info['country']].reject{|v| !v || v.empty?}.join(', ')
|
25
28
|
}
|
26
29
|
end
|
27
30
|
|
@@ -24,4 +24,44 @@ describe OmniAuth::Strategies::Meetup do
|
|
24
24
|
subject.callback_path.should eq('/auth/meetup/callback')
|
25
25
|
end
|
26
26
|
end
|
27
|
+
|
28
|
+
describe '#uid' do
|
29
|
+
it 'returns the uid from raw_info' do
|
30
|
+
subject.stub(:raw_info) { { 'id' => '999' } }
|
31
|
+
subject.uid.should == '999'
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
describe '#info' do
|
36
|
+
it 'returns the name from raw_info' do
|
37
|
+
subject.stub(:raw_info) { { 'name' => 'Bert' }}
|
38
|
+
subject.info[:name].should == 'Bert'
|
39
|
+
end
|
40
|
+
|
41
|
+
it 'returns the photo_url from raw_info if available' do
|
42
|
+
subject.stub(:raw_info) { { 'photo' => { 'photo_link' => 'http://meetup.com/bert.jpg' } }}
|
43
|
+
subject.info[:photo_url].should == 'http://meetup.com/bert.jpg'
|
44
|
+
subject.stub(:raw_info) {{}}
|
45
|
+
subject.info[:photo_url].should == nil
|
46
|
+
end
|
47
|
+
|
48
|
+
it 'returns the public_profile url' do
|
49
|
+
subject.stub(:raw_info) { { 'link' => 'http://meetup.com/bert' }}
|
50
|
+
subject.info[:urls][:public_profile].should == 'http://meetup.com/bert'
|
51
|
+
end
|
52
|
+
|
53
|
+
it 'returns the description from raw_info' do
|
54
|
+
subject.stub(:raw_info) { { 'bio' => 'My name is Bert.' }}
|
55
|
+
subject.info[:description].should == 'My name is Bert.'
|
56
|
+
end
|
57
|
+
|
58
|
+
it 'returns the location from raw_info' do
|
59
|
+
subject.stub(:raw_info) { { 'city' => 'Los Angeles', 'state' => 'CA', 'country' => 'USA' }}
|
60
|
+
subject.info[:location].should == 'Los Angeles, CA, USA'
|
61
|
+
subject.stub(:raw_info) { { 'city' => 'Tokyo', 'country' => 'Japan' }}
|
62
|
+
subject.info[:location].should == 'Tokyo, Japan'
|
63
|
+
subject.stub(:raw_info) {{}}
|
64
|
+
subject.info[:location].should == ''
|
65
|
+
end
|
66
|
+
end
|
27
67
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,8 +1,13 @@
|
|
1
|
+
Dir[File.expand_path('../support/**/*', __FILE__)].each { |f| require f }
|
1
2
|
require 'bundler/setup'
|
2
3
|
require 'rspec'
|
3
|
-
|
4
|
-
|
4
|
+
require 'rack/test'
|
5
|
+
require 'webmock/rspec'
|
6
|
+
require 'omniauth'
|
5
7
|
require 'omniauth-meetup'
|
6
8
|
|
7
9
|
RSpec.configure do |config|
|
10
|
+
config.include WebMock::API
|
11
|
+
config.include Rack::Test::Methods
|
12
|
+
config.extend OmniAuth::Test::StrategyMacros, :type => :strategy
|
8
13
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-meetup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-12-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: omniauth
|