omniauth-untappd 0.1.0 → 0.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c3163d5fb4eb4e058eaa19aec1a5bade542c6fda
4
- data.tar.gz: 394f945ab90fa2b2d298e63019aa0dc60239ec23
3
+ metadata.gz: d0ad89682af8fc3f04471b69b3fac0aefe63fdcf
4
+ data.tar.gz: 996d3516d2fb95b5b1f28a7a866aad18842c438b
5
5
  SHA512:
6
- metadata.gz: 78ac968481f9340e4d4eee8d3165c51e15efa4d9805bc76235f937a28285b7ee17c12dcd03a14030aecd8a2c34bc3fe35c665245b959043fbe01a68588fbe4cd
7
- data.tar.gz: 85d0f9a6c4803201831c3d21471daa66ae1826851cc59560bd1ad2e53e269099b37c52eed7873bc460257ac23ed646f1be87cc4fe199ef18284915c2a7ab7266
6
+ metadata.gz: 1b298cf46d7883aa58488b6852995aad9e22caf4a7ad6b824a73ad6d473aa0d4e6f97ed8c21562b60d6572ccdecb70281ca8499395bea043170a585997ab1c4a
7
+ data.tar.gz: d9ceea445eb339182d85c8530229cd6188802930bc7e222c5a8ffb97a8cb22881de8f11683a7345b7e35883fc5661d373019997e8105b318f401b69770d89eb0
data/README.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # Omniauth::Untappd
2
2
 
3
- Untappd OAuth2 Strategy for OmniAuth.
3
+ [![Gem Version](https://badge.fury.io/rb/omniauth-untappd.png)](http://badge.fury.io/rb/omniauth-untappd)
4
+ [![Dependency Status](https://gemnasium.com/sabotatore/omniauth-untappd.png)](https://gemnasium.com/sabotatore/omniauth-untappd)
5
+ [![Code Climate](https://codeclimate.com/github/sabotatore/omniauth-untappd.png)](https://codeclimate.com/github/sabotatore/omniauth-untappd)
4
6
 
5
- [![Gem Version](https://badge.fury.io/rb/omniauth-untappd.png)](http://badge.fury.io/rb/omniauth-untappd) [![Dependency Status](https://gemnasium.com/sabotatore/omniauth-untappd.png)](https://gemnasium.com/sabotatore/omniauth-untappd)
7
+ Untappd OAuth2 Strategy for OmniAuth.
6
8
 
7
9
  ## Installation
8
10
 
@@ -32,7 +34,8 @@ See more details on the omniauth module: https://github.com/intridea/omniauth#re
32
34
 
33
35
  OmniAuth Untappd is tested under 1.9.2, 1.9.3 and 2.0.0
34
36
 
35
- [![Build Status](https://travis-ci.org/sabotatore/omniauth-untappd.png)](https://travis-ci.org/sabotatore/omniauth-untappd) [![Code Climate](https://codeclimate.com/github/sabotatore/omniauth-untappd.png)](https://codeclimate.com/github/sabotatore/omniauth-untappd)
37
+ [![Build Status](https://travis-ci.org/sabotatore/omniauth-untappd.png?branch=master)](https://travis-ci.org/sabotatore/omniauth-untappd)
38
+ [![Coverage Status](https://coveralls.io/repos/sabotatore/omniauth-untappd/badge.png)](https://coveralls.io/r/sabotatore/omniauth-untappd)
36
39
 
37
40
  ## License
38
41
 
@@ -1,4 +1,5 @@
1
- require 'omniauth-oauth2'
1
+ require 'omniauth/strategies/oauth2'
2
+ require 'oauth2/untappd_client'
2
3
 
3
4
  module OmniAuth
4
5
  module Strategies
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Untappd
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
@@ -1,3 +1,2 @@
1
1
  require 'omniauth-untappd/version'
2
- require 'oauth2/untappd_client'
3
2
  require 'omniauth/strategies/untappd'
@@ -25,4 +25,5 @@ Gem::Specification.new do |gem|
25
25
  gem.add_development_dependency 'rack-test'
26
26
  gem.add_development_dependency 'webmock'
27
27
  gem.add_development_dependency 'simplecov'
28
+ gem.add_development_dependency 'coveralls'
28
29
  end
@@ -3,6 +3,9 @@ require 'spec_helper'
3
3
  describe OmniAuth::Strategies::Untappd do
4
4
  subject(:strategy) { OmniAuth::Strategies::Untappd.new('client_id', 'client_secret') }
5
5
 
6
+ before { OmniAuth.config.test_mode = true }
7
+ after { OmniAuth.config.test_mode = false }
8
+
6
9
  let(:parsed_response) {{ 'response' => {
7
10
  'user' => {
8
11
  'id' => '123',
@@ -36,7 +39,23 @@ describe OmniAuth::Strategies::Untappd do
36
39
 
37
40
  its(:parse) { should eql :json }
38
41
  end
42
+ end
43
+
44
+ describe 'add redirect_url to params' do
45
+ let(:callback_url) { 'callback_url' }
46
+ before { expect(strategy).to receive(:callback_url).and_return(callback_url) }
47
+
48
+ context '#token_params' do
49
+ subject { strategy.token_params }
50
+
51
+ its(:redirect_url) { should eql callback_url }
52
+ end
39
53
 
54
+ context '#authorize_params' do
55
+ subject { strategy.authorize_params }
56
+
57
+ its(:redirect_url) { should eql callback_url }
58
+ end
40
59
  end
41
60
 
42
61
  context '#raw_info' do
@@ -46,7 +65,7 @@ describe OmniAuth::Strategies::Untappd do
46
65
  let(:user_info_url) { 'http://api.untappd.com/v4/user/info' }
47
66
 
48
67
  before { strategy.stub(access_token: access_token) }
49
- before { access_token.should_receive(:get).with(user_info_url).and_return(response) }
68
+ before { expect(access_token).to receive(:get).with(user_info_url).and_return(response) }
50
69
 
51
70
  it { should eql(parsed_response['response']['user']) }
52
71
 
data/spec/spec_helper.rb CHANGED
@@ -1,7 +1,14 @@
1
1
  $:.unshift File.expand_path('..', __FILE__)
2
2
  $:.unshift File.expand_path('../../lib', __FILE__)
3
+
3
4
  require 'simplecov'
5
+ require 'coveralls'
6
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
7
+ SimpleCov::Formatter::HTMLFormatter,
8
+ Coveralls::SimpleCov::Formatter
9
+ ]
4
10
  SimpleCov.start
11
+
5
12
  require 'rspec'
6
13
  require 'rack/test'
7
14
  require 'webmock/rspec'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-untappd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vitali Kulikou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-03 00:00:00.000000000 Z
11
+ date: 2013-12-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - '>='
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: coveralls
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - '>='
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
111
125
  description: Untappd OAuth2 Strategy for OmniAuth.
112
126
  email:
113
127
  - sabotatore@gmail.com