devise-remote-user 0.6.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aab12f2759e6c350adbd4c037be2290e95b408ae
4
- data.tar.gz: 9dea14310c1ba531b8bf0da6a94eeb3559550662
3
+ metadata.gz: 35135c10ba5cffe83e88acb6148e851a2eb33bd1
4
+ data.tar.gz: 5e1ed150ac1251033c421ed4f999d29b3f5de148
5
5
  SHA512:
6
- metadata.gz: d2e75c1ac8b983007f8f2ff22d5d16ef82dcd4cc2ee592025e6cb45b9e7d2d5a0fb7ac49777090fb8f20360a38c0af86d079875d971e03f30d3688c799e3b528
7
- data.tar.gz: a9794f5bca35f544719e248ae742b887564e1c8201d7fa5c5c60f402491b06d77e8af8ec5e20096a47b924c67cf469a663aa3b4decb350d2434ba536bb0d1e02
6
+ metadata.gz: '08f5dfb7b0d0524643a644908f517eeef7bcb9e72dc5432fb270f5669515335b0e874213fa2487d0fe2d8c282f16f2e0ccd47c5b74660b5a3ec7d73c8955bf5a'
7
+ data.tar.gz: d027daad5c3dcd904bb2621dcd6fe8afc0521f8815ced66942746724f33479c67eccd7f1f4f29e649a51f5ed2b92d7eb25ff4f7bec514b5d7575a3d445f22477
data/Rakefile CHANGED
@@ -12,6 +12,5 @@ require 'rspec/core/rake_task'
12
12
  RSpec::Core::RakeTask.new(:spec)
13
13
 
14
14
  require 'engine_cart/rake_task'
15
- EngineCart.fingerprint_proc = EngineCart.rails_fingerprint_proc
16
15
 
17
16
  task ci: ['engine_cart:generate', 'spec']
@@ -23,5 +23,5 @@ Gem::Specification.new do |s|
23
23
  s.add_development_dependency "rspec-rails", "~> 3.4"
24
24
  s.add_development_dependency "factory_girl_rails"
25
25
  s.add_development_dependency "capybara"
26
- s.add_development_dependency "engine_cart"
26
+ s.add_development_dependency "engine_cart", "~> 2.0"
27
27
  end
@@ -27,6 +27,10 @@ module DeviseRemoteUser
27
27
  end
28
28
 
29
29
  def create_user
30
+ unless Devise.mappings[:user].strategies.include?(:database_authenticatable)
31
+ return klass.create(user_criterion)
32
+ end
33
+
30
34
  random_password = SecureRandom.hex(16)
31
35
  attrs = user_criterion.merge({password: random_password, password_confirmation: random_password})
32
36
  klass.create(attrs)
@@ -1,3 +1,3 @@
1
1
  module DeviseRemoteUser
2
- VERSION = '0.6.0'
2
+ VERSION = '1.0.0'
3
3
  end
@@ -22,5 +22,29 @@ RSpec.describe DeviseRemoteUser do
22
22
  expect(DeviseRemoteUser.remote_user_id(mock_env)).to eq "some-id@example.com"
23
23
  end
24
24
  end
25
+
26
+ describe 'create_user' do
27
+ before do
28
+ allow(Devise.mappings[:user]).to receive(:strategies).and_return(stratagies)
29
+ end
30
+
31
+ let(:manager) { DeviseRemoteUser::Manager.new(User, 'REMOTE_USER' => 'some-id') }
32
+ context 'with a user that is database authenticatable' do
33
+ let(:stratagies) { [:database_authenticatable] }
34
+ it 'returns a user with a paswword' do
35
+ expect(User).to receive(:create).with(hash_including(:password))
36
+ manager.create_user
37
+ end
38
+ end
39
+
40
+ context 'with a user that is not database authenticatable' do
41
+ let(:stratagies) { [] }
42
+
43
+ it 'returns a user without a paswword' do
44
+ expect(User).to receive(:create).with(hash_excluding(:password))
45
+ manager.create_user
46
+ end
47
+ end
48
+ end
25
49
  end
26
50
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise-remote-user
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Chandek-Stark
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-05 00:00:00.000000000 Z
11
+ date: 2018-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: devise
@@ -84,16 +84,16 @@ dependencies:
84
84
  name: engine_cart
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0'
89
+ version: '2.0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0'
96
+ version: '2.0'
97
97
  description: A devise extension for remote user authentication.
98
98
  email:
99
99
  - lib-drs@duke.edu
@@ -122,7 +122,6 @@ files:
122
122
  - lib/devise_remote_user/version.rb
123
123
  - spec/controllers/application_controller_spec.rb
124
124
  - spec/controllers/devise/sessions_controller_spec.rb
125
- - spec/examples.txt
126
125
  - spec/factories/user_factories.rb
127
126
  - spec/lib/devise_remote_user_spec.rb
128
127
  - spec/spec_helper.rb
@@ -148,16 +147,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
147
  version: '0'
149
148
  requirements: []
150
149
  rubyforge_project:
151
- rubygems_version: 2.5.1
150
+ rubygems_version: 2.6.11
152
151
  signing_key:
153
152
  specification_version: 4
154
153
  summary: A devise extension for remote user authentication.
155
154
  test_files:
156
- - spec/controllers/application_controller_spec.rb
157
- - spec/controllers/devise/sessions_controller_spec.rb
158
- - spec/examples.txt
159
- - spec/factories/user_factories.rb
160
- - spec/lib/devise_remote_user_spec.rb
161
155
  - spec/spec_helper.rb
156
+ - spec/factories/user_factories.rb
162
157
  - spec/test_app_templates/20131101184256_add_name_fields_to_user.rb
163
158
  - spec/test_app_templates/lib/generators/test_app_generator.rb
159
+ - spec/lib/devise_remote_user_spec.rb
160
+ - spec/controllers/devise/sessions_controller_spec.rb
161
+ - spec/controllers/application_controller_spec.rb
@@ -1,15 +0,0 @@
1
- example_id | status | run_time |
2
- -------------------------------------------------------------- | ------ | --------------- |
3
- ./spec/controllers/application_controller_spec.rb[1:1:1:1] | passed | 0.01553 seconds |
4
- ./spec/controllers/application_controller_spec.rb[1:1:2:1] | passed | 0.02204 seconds |
5
- ./spec/controllers/application_controller_spec.rb[1:1:3:1:1] | passed | 0.01634 seconds |
6
- ./spec/controllers/application_controller_spec.rb[1:1:3:2:1] | passed | 0.00825 seconds |
7
- ./spec/controllers/application_controller_spec.rb[1:1:4:1:1] | passed | 0.02137 seconds |
8
- ./spec/controllers/application_controller_spec.rb[1:1:4:2:1] | passed | 0.07335 seconds |
9
- ./spec/controllers/application_controller_spec.rb[1:1:5:1:1] | passed | 0.01888 seconds |
10
- ./spec/controllers/application_controller_spec.rb[1:1:5:2:1:1] | passed | 0.01406 seconds |
11
- ./spec/controllers/application_controller_spec.rb[1:1:5:2:2:1] | passed | 0.01957 seconds |
12
- ./spec/controllers/devise/sessions_controller_spec.rb[1:1:1:1] | passed | 0.00927 seconds |
13
- ./spec/controllers/devise/sessions_controller_spec.rb[1:1:2:1] | passed | 0.00217 seconds |
14
- ./spec/lib/devise_remote_user_spec.rb[1:1:1:1] | passed | 0.00054 seconds |
15
- ./spec/lib/devise_remote_user_spec.rb[1:1:2:1] | passed | 0.00065 seconds |