omniauth 1.1.4 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of omniauth might be problematic. Click here for more details.

@@ -1,43 +1,49 @@
1
1
  require 'helper'
2
2
 
3
3
  describe OmniAuth do
4
- describe ".strategies" do
5
- it "increases when a new strategy is made" do
6
- expect{
4
+ describe '.strategies' do
5
+ it 'increases when a new strategy is made' do
6
+ expect do
7
7
  class ExampleStrategy
8
8
  include OmniAuth::Strategy
9
9
  end
10
- }.to change(OmniAuth.strategies, :size).by(1)
10
+ end.to change(OmniAuth.strategies, :size).by(1)
11
11
  expect(OmniAuth.strategies.last).to eq(ExampleStrategy)
12
12
  end
13
13
  end
14
14
 
15
- context "configuration" do
16
- describe ".defaults" do
17
- it "is a hash of default configuration" do
15
+ context 'configuration' do
16
+ describe '.defaults' do
17
+ it 'is a hash of default configuration' do
18
18
  expect(OmniAuth::Configuration.defaults).to be_kind_of(Hash)
19
19
  end
20
20
  end
21
21
 
22
- it "is callable from .configure" do
22
+ it 'is callable from .configure' do
23
23
  OmniAuth.configure do |c|
24
24
  expect(c).to be_kind_of(OmniAuth::Configuration)
25
25
  end
26
26
  end
27
27
 
28
28
  before do
29
- @old_path_prefix = OmniAuth.config.path_prefix
30
- @old_on_failure = OmniAuth.config.on_failure
29
+ @old_path_prefix = OmniAuth.config.path_prefix
30
+ @old_on_failure = OmniAuth.config.on_failure
31
+ @old_before_callback_phase = OmniAuth.config.before_callback_phase
32
+ @old_before_options_phase = OmniAuth.config.before_options_phase
33
+ @old_before_request_phase = OmniAuth.config.before_request_phase
31
34
  end
32
35
 
33
36
  after do
34
37
  OmniAuth.configure do |config|
35
- config.path_prefix = @old_path_prefix
36
- config.on_failure = @old_on_failure
38
+ config.path_prefix = @old_path_prefix
39
+ config.on_failure = @old_on_failure
40
+ config.before_callback_phase = @old_before_callback_phase
41
+ config.before_options_phase = @old_before_options_phase
42
+ config.before_request_phase = @old_before_request_phase
37
43
  end
38
44
  end
39
45
 
40
- it "is able to set the path" do
46
+ it 'is able to set the path' do
41
47
  OmniAuth.configure do |config|
42
48
  config.path_prefix = '/awesome'
43
49
  end
@@ -45,7 +51,7 @@ describe OmniAuth do
45
51
  expect(OmniAuth.config.path_prefix).to eq('/awesome')
46
52
  end
47
53
 
48
- it "is able to set the on_failure rack app" do
54
+ it 'is able to set the on_failure rack app' do
49
55
  OmniAuth.configure do |config|
50
56
  config.on_failure do
51
57
  'yoyo'
@@ -54,21 +60,49 @@ describe OmniAuth do
54
60
 
55
61
  expect(OmniAuth.config.on_failure.call).to eq('yoyo')
56
62
  end
57
- describe "mock auth" do
63
+
64
+ it 'is able to set hook on option_call' do
65
+ OmniAuth.configure do |config|
66
+ config.before_options_phase do
67
+ 'yoyo'
68
+ end
69
+ end
70
+ expect(OmniAuth.config.before_options_phase.call).to eq('yoyo')
71
+ end
72
+
73
+ it 'is able to set hook on request_call' do
74
+ OmniAuth.configure do |config|
75
+ config.before_request_phase do
76
+ 'heyhey'
77
+ end
78
+ end
79
+ expect(OmniAuth.config.before_request_phase.call).to eq('heyhey')
80
+ end
81
+
82
+ it 'is able to set hook on callback_call' do
83
+ OmniAuth.configure do |config|
84
+ config.before_callback_phase do
85
+ 'heyhey'
86
+ end
87
+ end
88
+ expect(OmniAuth.config.before_callback_phase.call).to eq('heyhey')
89
+ end
90
+
91
+ describe 'mock auth' do
58
92
  before do
59
- OmniAuth.config.add_mock(:facebook, :uid => '12345',:info=>{:name=>'Joe', :email=>'joe@example.com'})
93
+ OmniAuth.config.add_mock(:facebook, :uid => '12345', :info => {:name => 'Joe', :email => 'joe@example.com'})
60
94
  end
61
- it "default should be AuthHash" do
95
+ it 'default is AuthHash' do
62
96
  OmniAuth.configure do |config|
63
97
  expect(config.mock_auth[:default]).to be_kind_of(OmniAuth::AuthHash)
64
98
  end
65
99
  end
66
- it "facebook should be AuthHash" do
100
+ it 'facebook is AuthHash' do
67
101
  OmniAuth.configure do |config|
68
102
  expect(config.mock_auth[:facebook]).to be_kind_of(OmniAuth::AuthHash)
69
103
  end
70
104
  end
71
- it "sets facebook attributes" do
105
+ it 'sets facebook attributes' do
72
106
  OmniAuth.configure do |config|
73
107
  expect(config.mock_auth[:facebook].uid).to eq('12345')
74
108
  expect(config.mock_auth[:facebook].info.name).to eq('Joe')
@@ -78,31 +112,31 @@ describe OmniAuth do
78
112
  end
79
113
  end
80
114
 
81
- describe ".logger" do
82
- it "calls through to the configured logger" do
83
- OmniAuth.stub(:config => mock(:logger => "foo"))
84
- expect(OmniAuth.logger).to eq("foo")
115
+ describe '.logger' do
116
+ it 'calls through to the configured logger' do
117
+ allow(OmniAuth).to receive(:config).and_return(double(:logger => 'foo'))
118
+ expect(OmniAuth.logger).to eq('foo')
85
119
  end
86
120
  end
87
121
 
88
- describe "::Utils" do
89
- describe ".deep_merge" do
90
- it "combines hashes" do
91
- expect(OmniAuth::Utils.deep_merge({'abc' => {'def' => 123}}, {'abc' => {'foo' => 'bar'}})).to eq({'abc' => {'def' => 123, 'foo' => 'bar'}})
122
+ describe '::Utils' do
123
+ describe '.deep_merge' do
124
+ it 'combines hashes' do
125
+ expect(OmniAuth::Utils.deep_merge({'abc' => {'def' => 123}}, {'abc' => {'foo' => 'bar'}})).to eq('abc' => {'def' => 123, 'foo' => 'bar'})
92
126
  end
93
127
  end
94
128
 
95
- describe ".camelize" do
96
- it "works on normal cases" do
129
+ describe '.camelize' do
130
+ it 'works on normal cases' do
97
131
  {
98
132
  'some_word' => 'SomeWord',
99
133
  'AnotherWord' => 'AnotherWord',
100
134
  'one' => 'One',
101
135
  'three_words_now' => 'ThreeWordsNow'
102
- }.each_pair{ |k,v| expect(OmniAuth::Utils.camelize(k)).to eq(v) }
136
+ }.each_pair { |k, v| expect(OmniAuth::Utils.camelize(k)).to eq(v) }
103
137
  end
104
138
 
105
- it "works in special cases that have been added" do
139
+ it 'works in special cases that have been added' do
106
140
  OmniAuth.config.add_camelization('oauth', 'OAuth')
107
141
  expect(OmniAuth::Utils.camelize(:oauth)).to eq('OAuth')
108
142
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Bleigh
@@ -30,54 +30,54 @@ cert_chain:
30
30
  Sf3lVKpBCWgRpGTvy45XVpB+59y33PJmEuQ1PTEOYvQyao9UKMAAaAN/7qWQtjl0
31
31
  hlw=
32
32
  -----END CERTIFICATE-----
33
- date: 2013-04-08 00:00:00.000000000 Z
33
+ date: 2014-01-16 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: hashie
37
37
  requirement: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - '>='
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
41
  version: '1.2'
42
- - - <
42
+ - - "<"
43
43
  - !ruby/object:Gem::Version
44
44
  version: '3'
45
45
  type: :runtime
46
46
  prerelease: false
47
47
  version_requirements: !ruby/object:Gem::Requirement
48
48
  requirements:
49
- - - '>='
49
+ - - ">="
50
50
  - !ruby/object:Gem::Version
51
51
  version: '1.2'
52
- - - <
52
+ - - "<"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rack
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '1.0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: '1.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '1.0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1.0'
83
83
  description: A generalized Rack framework for multiple-provider authentication.
@@ -88,23 +88,33 @@ executables: []
88
88
  extensions: []
89
89
  extra_rdoc_files: []
90
90
  files:
91
- - .yardopts
91
+ - ".gemtest"
92
+ - ".gitignore"
93
+ - ".rspec"
94
+ - ".rubocop.yml"
95
+ - ".travis.yml"
96
+ - ".yardopts"
97
+ - Gemfile
98
+ - Gemfile.rack-1.3.x
99
+ - Guardfile
92
100
  - LICENSE.md
93
101
  - README.md
94
102
  - Rakefile
95
- - omniauth.gemspec
103
+ - certs/sferik.pem
104
+ - lib/omniauth.rb
96
105
  - lib/omniauth/auth_hash.rb
97
106
  - lib/omniauth/builder.rb
98
107
  - lib/omniauth/failure_endpoint.rb
108
+ - lib/omniauth/form.css
99
109
  - lib/omniauth/form.rb
100
110
  - lib/omniauth/strategies/developer.rb
101
111
  - lib/omniauth/strategy.rb
112
+ - lib/omniauth/test.rb
102
113
  - lib/omniauth/test/phony_session.rb
103
114
  - lib/omniauth/test/strategy_macros.rb
104
115
  - lib/omniauth/test/strategy_test_case.rb
105
- - lib/omniauth/test.rb
106
116
  - lib/omniauth/version.rb
107
- - lib/omniauth.rb
117
+ - omniauth.gemspec
108
118
  - spec/helper.rb
109
119
  - spec/omniauth/auth_hash_spec.rb
110
120
  - spec/omniauth/builder_spec.rb
@@ -123,17 +133,17 @@ require_paths:
123
133
  - lib
124
134
  required_ruby_version: !ruby/object:Gem::Requirement
125
135
  requirements:
126
- - - '>='
136
+ - - ">="
127
137
  - !ruby/object:Gem::Version
128
138
  version: '0'
129
139
  required_rubygems_version: !ruby/object:Gem::Requirement
130
140
  requirements:
131
- - - '>='
141
+ - - ">="
132
142
  - !ruby/object:Gem::Version
133
- version: 1.3.6
143
+ version: 1.3.5
134
144
  requirements: []
135
145
  rubyforge_project:
136
- rubygems_version: 2.0.0
146
+ rubygems_version: 2.2.0
137
147
  signing_key:
138
148
  specification_version: 4
139
149
  summary: A generalized Rack framework for multiple-provider authentication.
metadata.gz.sig CHANGED
Binary file