omniauth-wordpress 0.1.1 → 0.2.0
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 +7 -0
- data/lib/omniauth/wordpress/version.rb +1 -1
- data/omniauth-wordpress.gemspec +1 -1
- data/spec/omniauth/strategies/wordpress_spec.rb +37 -3
- metadata +41 -30
- data/spec/spec_helper.rb +0 -6
- data/spec/support/shared_examples.rb +0 -37
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f511ef71f7c17f663e9be374631432cbaa269ea4
|
4
|
+
data.tar.gz: bb7f8a1285b0fd73e4c310920a1afc38a40e6fae
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 68df9bc48e492e08d1c27c9b6fee32160cfe602ccf89bfcbdf6f79f51e44e90475fa1afba3c483f4588fd51cc47b747457df7625a2bf9da4a1067b983492447c
|
7
|
+
data.tar.gz: 4c3679ae078bd247fafcd9e69835399f9e3c44b8eeeaea3a1014a4437d5471ccd97fbbe6a77f281ef58fe38a44c73603c74d277607265b3e06333ef02c39cdbc
|
data/omniauth-wordpress.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
17
17
|
s.require_paths = ["lib"]
|
18
18
|
|
19
|
-
s.add_runtime_dependency 'omniauth-oauth2', '~> 1.
|
19
|
+
s.add_runtime_dependency 'omniauth-oauth2', '~> 1.1.0'
|
20
20
|
|
21
21
|
s.add_development_dependency 'rspec', '~> 2.7.0'
|
22
22
|
s.add_development_dependency 'rake'
|
@@ -1,7 +1,10 @@
|
|
1
|
-
require 'spec_helper'
|
2
1
|
require 'omniauth-wordpress'
|
3
2
|
|
4
3
|
describe OmniAuth::Strategies::Wordpress do
|
4
|
+
before(:all) do
|
5
|
+
OmniAuth.config.test_mode = true
|
6
|
+
end
|
7
|
+
|
5
8
|
before :each do
|
6
9
|
@request = double('Request')
|
7
10
|
@request.stub(:params) { {} }
|
@@ -19,9 +22,12 @@ describe OmniAuth::Strategies::Wordpress do
|
|
19
22
|
end
|
20
23
|
end
|
21
24
|
|
22
|
-
it_should_behave_like 'an oauth2 strategy'
|
23
|
-
|
24
25
|
describe '#client' do
|
26
|
+
it 'should be initialized with symbolized client_options' do
|
27
|
+
@options = { :client_options => { 'authorize_url' => 'https://example.com' } }
|
28
|
+
subject.client.options[:authorize_url].should == 'https://example.com'
|
29
|
+
end
|
30
|
+
|
25
31
|
it 'has correct Wordpress site' do
|
26
32
|
subject.client.site.should eq('https://public-api.wordpress.com')
|
27
33
|
end
|
@@ -35,4 +41,32 @@ describe OmniAuth::Strategies::Wordpress do
|
|
35
41
|
end
|
36
42
|
end
|
37
43
|
|
44
|
+
describe '#authorize_params' do
|
45
|
+
it 'should include any authorize params passed in the :authorize_params option' do
|
46
|
+
@options = { :authorize_params => { :foo => 'bar', :baz => 'zip' } }
|
47
|
+
subject.authorize_params['foo'].should eq('bar')
|
48
|
+
subject.authorize_params['baz'].should eq('zip')
|
49
|
+
end
|
50
|
+
|
51
|
+
it 'should include top-level options that are marked as :authorize_options' do
|
52
|
+
@options = { :authorize_options => [:scope, :foo], :scope => 'bar', :foo => 'baz' }
|
53
|
+
subject.authorize_params['scope'].should eq('bar')
|
54
|
+
subject.authorize_params['foo'].should eq('baz')
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
describe '#token_params' do
|
59
|
+
it 'should include any authorize params passed in the :authorize_params option' do
|
60
|
+
@options = { :token_params => { :foo => 'bar', :baz => 'zip' } }
|
61
|
+
subject.token_params['foo'].should eq('bar')
|
62
|
+
subject.token_params['baz'].should eq('zip')
|
63
|
+
end
|
64
|
+
|
65
|
+
it 'should include top-level options that are marked as :authorize_options' do
|
66
|
+
@options = { :token_options => [:scope, :foo], :scope => 'bar', :foo => 'baz' }
|
67
|
+
subject.token_params['scope'].should eq('bar')
|
68
|
+
subject.token_params['foo'].should eq('baz')
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
38
72
|
end
|
metadata
CHANGED
@@ -1,71 +1,85 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-wordpress
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.2.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Magda Sikorska
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2013-08-05 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: omniauth-oauth2
|
16
|
-
requirement:
|
17
|
-
none: false
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
18
16
|
requirements:
|
19
17
|
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.
|
19
|
+
version: 1.1.0
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
|
-
version_requirements:
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.1.0
|
25
27
|
- !ruby/object:Gem::Dependency
|
26
28
|
name: rspec
|
27
|
-
requirement:
|
28
|
-
none: false
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
29
30
|
requirements:
|
30
31
|
- - ~>
|
31
32
|
- !ruby/object:Gem::Version
|
32
33
|
version: 2.7.0
|
33
34
|
type: :development
|
34
35
|
prerelease: false
|
35
|
-
version_requirements:
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 2.7.0
|
36
41
|
- !ruby/object:Gem::Dependency
|
37
42
|
name: rake
|
38
|
-
requirement:
|
39
|
-
none: false
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
40
44
|
requirements:
|
41
|
-
- -
|
45
|
+
- - '>='
|
42
46
|
- !ruby/object:Gem::Version
|
43
47
|
version: '0'
|
44
48
|
type: :development
|
45
49
|
prerelease: false
|
46
|
-
version_requirements:
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
47
55
|
- !ruby/object:Gem::Dependency
|
48
56
|
name: webmock
|
49
|
-
requirement:
|
50
|
-
none: false
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
51
58
|
requirements:
|
52
|
-
- -
|
59
|
+
- - '>='
|
53
60
|
- !ruby/object:Gem::Version
|
54
61
|
version: '0'
|
55
62
|
type: :development
|
56
63
|
prerelease: false
|
57
|
-
version_requirements:
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
58
69
|
- !ruby/object:Gem::Dependency
|
59
70
|
name: rack-test
|
60
|
-
requirement:
|
61
|
-
none: false
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
62
72
|
requirements:
|
63
|
-
- -
|
73
|
+
- - '>='
|
64
74
|
- !ruby/object:Gem::Version
|
65
75
|
version: '0'
|
66
76
|
type: :development
|
67
77
|
prerelease: false
|
68
|
-
version_requirements:
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
description: Wordpress strategy for OmniAuth.
|
70
84
|
email:
|
71
85
|
- madzia.sikorska@gmail.com
|
@@ -83,30 +97,27 @@ files:
|
|
83
97
|
- lib/omniauth/wordpress/version.rb
|
84
98
|
- omniauth-wordpress.gemspec
|
85
99
|
- spec/omniauth/strategies/wordpress_spec.rb
|
86
|
-
- spec/spec_helper.rb
|
87
|
-
- spec/support/shared_examples.rb
|
88
100
|
homepage: https://github.com/elrosa/omniauth-wordpress
|
89
101
|
licenses: []
|
102
|
+
metadata: {}
|
90
103
|
post_install_message:
|
91
104
|
rdoc_options: []
|
92
105
|
require_paths:
|
93
106
|
- lib
|
94
107
|
required_ruby_version: !ruby/object:Gem::Requirement
|
95
|
-
none: false
|
96
108
|
requirements:
|
97
|
-
- -
|
109
|
+
- - '>='
|
98
110
|
- !ruby/object:Gem::Version
|
99
111
|
version: '0'
|
100
112
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
|
-
none: false
|
102
113
|
requirements:
|
103
|
-
- -
|
114
|
+
- - '>='
|
104
115
|
- !ruby/object:Gem::Version
|
105
116
|
version: '0'
|
106
117
|
requirements: []
|
107
118
|
rubyforge_project:
|
108
|
-
rubygems_version:
|
119
|
+
rubygems_version: 2.0.3
|
109
120
|
signing_key:
|
110
|
-
specification_version:
|
121
|
+
specification_version: 4
|
111
122
|
summary: Wordpress strategy for OmniAuth.
|
112
123
|
test_files: []
|
data/spec/spec_helper.rb
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
# NOTE it would be useful if this lived in omniauth-oauth2 eventually
|
2
|
-
shared_examples 'an oauth2 strategy' do
|
3
|
-
describe '#client' do
|
4
|
-
it 'should be initialized with symbolized client_options' do
|
5
|
-
@options = { :client_options => { 'authorize_url' => 'https://example.com' } }
|
6
|
-
subject.client.options[:authorize_url].should == 'https://example.com'
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
describe '#authorize_params' do
|
11
|
-
it 'should include any authorize params passed in the :authorize_params option' do
|
12
|
-
@options = { :authorize_params => { :foo => 'bar', :baz => 'zip' } }
|
13
|
-
subject.authorize_params['foo'].should eq('bar')
|
14
|
-
subject.authorize_params['baz'].should eq('zip')
|
15
|
-
end
|
16
|
-
|
17
|
-
it 'should include top-level options that are marked as :authorize_options' do
|
18
|
-
@options = { :authorize_options => [:scope, :foo], :scope => 'bar', :foo => 'baz' }
|
19
|
-
subject.authorize_params['scope'].should eq('bar')
|
20
|
-
subject.authorize_params['foo'].should eq('baz')
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
describe '#token_params' do
|
25
|
-
it 'should include any authorize params passed in the :authorize_params option' do
|
26
|
-
@options = { :token_params => { :foo => 'bar', :baz => 'zip' } }
|
27
|
-
subject.token_params['foo'].should eq('bar')
|
28
|
-
subject.token_params['baz'].should eq('zip')
|
29
|
-
end
|
30
|
-
|
31
|
-
it 'should include top-level options that are marked as :authorize_options' do
|
32
|
-
@options = { :token_options => [:scope, :foo], :scope => 'bar', :foo => 'baz' }
|
33
|
-
subject.token_params['scope'].should eq('bar')
|
34
|
-
subject.token_params['foo'].should eq('baz')
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|